/* ================================================================
   YumeList - SOCLE COMMUN (v2 « édition nocturne »)
   ----------------------------------------------------------------
   Ce fichier ne contient QUE ce qui est réellement partagé par
   plusieurs pages : jetons de design, reset, typographie, chrome de
   navigation, boutons, champs, modales, toasts, états vides.

   Tout ce qui appartient à une seule page vit dans sa feuille
   dédiée, chargée après celle-ci :
     index.html     → index.css
     profile.html   → profile.css
     anime.html     → anime.css
     showcase.html  → showcase.css
     admin.html     → admin.css
     landing.html   → landing.css (indépendante, namespace "l-")

   Le monde visuel est celui de la landing : encre + sakura + or,
   Noto Serif JP comme voix (titres), Inter pour la donnée et l'UI,
   séparation par filets d'1px plutôt que par cartes flottantes.
   ================================================================ */

/* ============================================================
   1. JETONS
============================================================ */
:root {
  /* - Encre : du fond vers le premier plan - */
  --ink:        #0a0a0f;
  --ink-2:      #12121a;
  --ink-3:      #1a1a26;
  --ink-4:      #22223a;

  /* - Voiles - */
  --glass:      rgba(255,255,255,0.04);
  --glass-2:    rgba(255,255,255,0.08);
  --border:     rgba(255,255,255,0.07);
  --border-2:   rgba(255,255,255,0.13);
  --border-1:   rgba(255,255,255,0.07); /* alias historique */

  /* - Accents - */
  --sakura:     #e8547a;
  --sakura-2:   #f07090;
  --sakura-pale:#fde8ef;
  --sakura-soft:rgba(232,84,122,.12);
  --sakura-line:rgba(232,84,122,.32);
  --sakura-deep:  #c93a60; /* aplats qui portent du texte blanc (4,9:1) */
  --sakura-deep-2:#d03e66; /* survol de ces aplats (4,6:1) */
  --red-deep:     #c53030; /* aplats danger avec texte blanc (5,5:1) */
  --gold:       #c9963a;
  --gold-pale:  #fdf0d0;

  /* - Texte - */
  --text:       #e8e4dc;
  --text-2:     #9e9a94;
  --text-3:     #8a857e; /* 5,4:1 sur encre - l’ancien #5e5a56 (2,9:1) échouait l’AA */
  --white:      #ffffff;

  /* - Sémantique - */
  --green:      #52c48c;
  --red:        #dc3c3c;
  --blue:       #5b9bd5;

  /* - Familles - */
  --font-body:  'Inter', system-ui, sans-serif;
  --font-jp:    'Noto Serif JP', serif;
  /* Grands titres de section (.ym-title, .ym-display) : lettres latines
     seules, un kanji retombe sur Noto Serif JP. Une seule graisse (400). */
  --font-titre: 'Mochiy Pop One', 'Noto Serif JP', serif;

  /* - Échelle typographique -
     Le display et les titres de section sont fluides : c'est ce qui
     donne à l'app le souffle de la landing. La donnée reste fixe. */
  --fs-display: clamp(38px, 5.2vw, 66px);
  --fs-title:   clamp(27px, 3.4vw, 40px);
  --fs-titre-section: clamp(23px, 3.4vw, 40px); /* Mochiy, plus large : « Ce que la communauté en pense » tient en 2 lignes à 320px */
  --fs-sub:     clamp(19px, 2vw, 23px);

  /* - Rayons - */
  --r-xs:       6px;
  --r:          10px;
  --r-lg:       16px;
  --r-xl:       22px;
  --r-pill:     999px;  /* seulement ce qui reste rond : compteurs, interrupteurs, barre de défilement */
  --r-ctrl:     3px;    /* boutons, pastilles, filtres, recherche : coins nets */

  /* - Sceau et fleur des contrôles - */
  --sceau-filet: color-mix(in srgb, var(--white) 45%, transparent);
  --fleur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg id='p'%3E%3Cpath d='M12 10.5C9.3 9.4 8.2 6.3 9.6 3.1L12 4.7l2.4-1.6c1.4 3.2.3 6.3-2.4 7.4Z'/%3E%3C/g%3E%3Cuse href='%23p' transform='rotate(72 12 12)'/%3E%3Cuse href='%23p' transform='rotate(144 12 12)'/%3E%3Cuse href='%23p' transform='rotate(216 12 12)'/%3E%3Cuse href='%23p' transform='rotate(288 12 12)'/%3E%3Ccircle cx='12' cy='12' r='1.1'/%3E%3C/svg%3E");

  /* - Mesure & rythme - */
  --container:  1240px;
  --gutter:     32px;
  --rhythm:     clamp(56px, 7vw, 104px);

  /* - Mouvement - */
  --ease:       cubic-bezier(.16,.84,.44,1);
  --ease-out:   cubic-bezier(.22,1,.36,1);

  /* - Valeurs qui basculent avec le thème -
       Elles étaient écrites en dur un peu partout : sorties ici, le
       thème clair peut les redéfinir sans toucher aux règles. - */
  --nav-bg:     rgba(10,10,15,.86);   /* barre, par-dessus un flou */
  --overlay:    rgba(6,6,9,.88);      /* voile derrière une modale */
  --veil:       rgba(255,255,255,.055); /* reflets et séparations claires */
  --veil-2:     rgba(255,255,255,.14);
  --scroll-thumb:       var(--ink-4);
  --scroll-thumb-hover: #2e2e4a;
  --shadow-1:   0 16px 40px rgba(0,0,0,.5);
  --shadow-2:   0 24px 60px -12px rgba(0,0,0,.7);
  --shadow-3:   0 32px 80px -20px rgba(0,0,0,.7);
  --shadow-hover: 0 28px 48px -16px rgba(0,0,0,.7); /* carte soulevée au survol */
  /* Sémantique lisible SUR une surface (le texte, pas l'aplat) */
  --green-text: #52c48c;
  --red-text:   #ef6b6b;
  --blue-text:  #9aa0ff;
  /* Texte posé SUR une affiche (pastille d'encre) : mêmes valeurs dans les deux thèmes */
  --poster-sakura: #e8547a;
  --poster-green:  #52c48c;
  --poster-gold:   #c9963a;
  --poster-red:    #ef6b6b;
  --poster-muted:  #9e9a94;

  /* - Ponts de compatibilité : ces noms sont utilisés dans des
       centaines de styles inline des pages. Ils restent, pointés
       sur les jetons ci-dessus. - */
  --accent:        var(--sakura);
  --accent-soft:   var(--sakura-soft);
  --accent-border: var(--sakura-line);
  --surface:       var(--ink-2);
  --surface-2:     var(--ink-3);
  --bg-elev:       var(--ink-3);
  --border-strong: var(--border-2);
  --text-1:        var(--text);
}

/* ============================================================
   1 bis. THÈME CLAIR - « édition de jour »
   ------------------------------------------------------------
   Posé sur <html data-theme="light"> par le script anti-clignotement
   en tête de chaque page, basculé par toggleTheme(). Ce n'est pas la
   négation du thème sombre : le papier remplace l'encre, l'accent est
   assombri pour rester lisible (le --sakura nocturne ne fait que 3,4:1
   sur fond clair, sous l'AA), et les ombres deviennent chaudes et
   basses. Les voiles posés SUR une affiche restent sombres dans les
   deux thèmes : le texte qui s'y pose est blanc.
   ============================================================ */
:root[data-theme="light"] {
  /* - Papier : du fond vers le premier plan (l'élévation éclaircit) - */
  --ink:        #f4efe8;
  --ink-2:      #fffdf9;
  --ink-3:      #ece5db;
  --ink-4:      #ddd4c6;

  /* - Voiles - */
  --glass:      rgba(40,28,18,.035);
  --glass-2:    rgba(40,28,18,.07);
  --border:     rgba(38,28,18,.11);
  --border-2:   rgba(38,28,18,.20);
  --border-1:   rgba(38,28,18,.11);

  /* - Accents assombris pour l'AA sur papier - */
  --sakura:       #c0325c; /* 5,4:1 sur --ink */
  --sakura-2:     #a92a50;
  --sakura-pale:  #7d1f3b;
  --sakura-soft:  rgba(192,50,92,.09);
  --sakura-line:  rgba(192,50,92,.30);
  --sakura-deep:  #b02d55; /* aplats qui portent du texte blanc (5,6:1) */
  --sakura-deep-2:#9b2649;
  --red-deep:     #b3261e;
  --gold:         #8a6420; /* l'or nocturne ne fait que 2,6:1 sur papier */
  --gold-pale:    #5d4211;

  /* - Texte - */
  --text:       #1b1916; /* 14,8:1 */
  --text-2:     #554e46; /* 7,4:1  */
  --text-3:     #6b635a; /* 5,2:1, AA à 14px */

  /* - Sémantique - */
  --green:      #14764b; /* pastille « Actif » : 4,27:1 en #1d8a5c, sous l'AA */
  --red:        #c03028;
  --blue:       #2c62a8;
  --green-text: #14764b;
  --red-text:   #b3261e;
  --blue-text:  #3b46b8;
  /* Sur une affiche, la pastille reste sombre : les teintes ne s'assombrissent pas */
  --poster-sakura: #e8547a;
  --poster-green:  #52c48c;
  --poster-gold:   #c9963a;
  --poster-red:    #ef6b6b;
  --poster-muted:  #9e9a94;

  /* - Valeurs qui basculent - */
  --nav-bg:     rgba(248,244,238,.88);
  --overlay:    rgba(48,38,30,.42);
  --veil:       rgba(38,28,18,.05);
  --veil-2:     rgba(38,28,18,.13);
  --scroll-thumb:       #cdc2b2;
  --scroll-thumb-hover: #b3a693;
  /* Ombres chaudes et basses : une ombre noire sur du papier fait sale */
  --shadow-1:   0 14px 32px rgba(60,42,28,.12);
  --shadow-2:   0 20px 48px -12px rgba(60,42,28,.18);
  --shadow-3:   0 28px 64px -20px rgba(60,42,28,.22);
  --shadow-hover: 0 22px 40px -16px rgba(60,42,28,.26);
}

/* ============================================================
   2. RESET & FOND
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Pas de fond sur <html> : celui du body se propage alors au canevas
   racine, ce qui laisse les canvas d'ambiance en z-index négatif
   (pétales motion.js / #sakura-canvas) visibles ENTRE le fond et le
   contenu, sans obliger chaque page à positionner ses blocs. */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
svg { display: block; }

/* Grain filmique : la même matière que la landing, posée sur toute
   l'app. Au-dessus du contenu, sous la nav (100) et les modales (200). */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Nappes de pétales (canvas 2D d'index.html, WebGL de motion.js) :
   fixées, derrière tout le contenu. */
#sakura-canvas, #ym-sakura-gl {
  position: fixed; inset: 0; z-index: -1;
  width: 100%; height: 100%; pointer-events: none;
}
#sakura-canvas { opacity: .5; }
/* Sur papier, les pétales roses ressortent bien plus que sur l'encre :
   on les retient pour qu'ils restent une ambiance, pas des taches. */
:root[data-theme="light"] #sakura-canvas { opacity: .34; }

/* ============================================================
   3. SURFACES DU NAVIGATEUR
   Sélection, curseur, ascenseur, anneau de focus : tout ce que le
   navigateur dessine par défaut et qui n'appartient à aucun design.
============================================================ */
/* --text et pas --white : en clair, du blanc sur le voile sakura serait illisible */
::selection { background: var(--sakura-line); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb); border-radius: var(--r-pill);
  border: 3px solid var(--ink);
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--sakura);
  outline-offset: 2px;
  border-radius: 3px;
}

input, textarea, select { caret-color: var(--sakura); }

::placeholder { color: var(--text-3); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   4. TYPOGRAPHIE
   Mochiy Pop One porte les grands titres de section, Noto Serif JP les
   autres titres (cartes, fiches). Inter porte la donnée.
============================================================ */
.ym-display {
  font: 400 var(--fs-display)/1.08 var(--font-titre);
  letter-spacing: 0; color: var(--text);
  text-wrap: balance;
}
.ym-title {
  font: 400 var(--fs-titre-section)/1.2 var(--font-titre);
  letter-spacing: 0; color: var(--text);
  text-wrap: balance;
}
.ym-title em, .ym-display em { font-style: normal; color: var(--sakura); }

.ym-sub {
  font: 500 var(--fs-sub)/1.35 var(--font-jp);
  color: var(--text); letter-spacing: -.01em;
}
/* Intertitre de bloc : Inter, pas de serif - c'est de l'étiquetage. */
.ym-label {
  font: 600 11px/1 var(--font-body);
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3);
}
.ym-lead {
  font: 400 15.5px/1.75 var(--font-body);
  color: var(--text-2); max-width: 62ch; text-wrap: pretty;
}

/* En-tête de section : le titre respire, l'intro est courte, et il
   y a toujours plus d'air au-dessus qu'en dessous. */
.ym-head { margin-bottom: 40px; max-width: 720px; }
.ym-head .ym-lead { margin-top: 14px; }

/* ============================================================
   5. MESURE & FILETS
   Le vocabulaire de mise en page de la landing : un conteneur, et
   des blocs séparés par des filets d'1px plutôt que par des cartes.
============================================================ */
.ym-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.ym-section { padding: var(--rhythm) 0; }
.ym-rule { height: 1px; background: var(--border); border: 0; }

/* Panneau : aplat d'encre, filet fin, jamais d'ombre au repos. */
.ym-panel {
  background: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 30px;
}

/* Icônes dessinées (SVG trait unique) - remplace les glyphes emoji
   partout où il s'agit d'un contrôle. */
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }

/* ============================================================
   6. NAVIGATION
============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  height: 72px; padding: 0 var(--gutter);
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
/* Marque : le logo d'origine (logo-header.svg), identique sur la landing. */
.nav-logo {
  display: flex; align-items: center; flex-shrink: 0;
  transition: opacity .25s ease;
}
.nav-logo img { height: 38px; width: auto; display: block; transition: transform .3s var(--ease); }
/* En thème clair, le « List » du logo est blanc sur papier : invisible.
   Variante logo-header-light.svg - même rose #EC4899, seuls le blanc et le
   gris des kana deviennent encre. Fait en CSS (et non en JS) pour que le bon
   fichier soit choisi dès le premier rendu, sans clignotement. */
:root[data-theme="light"] .nav-logo img { content: url("logo-header-light.svg"); }
.nav-logo:hover { opacity: .85; }
.nav-logo:hover img { transform: scale(1.04); }

/* Au bureau, .nav-sheet n'existe pas visuellement : ses deux enfants
   (.nav-links et .nav-right) participent directement à la barre. */
.nav-sheet { display: contents; }
.nav-burger { display: none; }

.nav-links { display: flex; align-items: center; gap: 4px; position: relative; min-width: 0; }
.nav-links a {
  position: relative;
  font: 500 13px var(--font-body); letter-spacing: .01em;
  color: var(--text-2); padding: 9px 14px; border-radius: var(--r-xs);
  white-space: nowrap; cursor: pointer;
  transition: color .22s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--sakura); }
/* Trait de pinceau sous la section affichée : un tracé SVG que
   updateNavIndicator() (index.html) étire d'un lien à l'autre. */
#navIndicator {
  position: absolute; left: 0; bottom: -2px; width: 100%; height: 10px;
  pointer-events: none;
}
#navIndicator svg { display: block; width: 100%; height: 100%; overflow: visible; }
#navIndicator path { fill: var(--sakura); }

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

/* ------------------------------------------------------------
   Interrupteur clair / sombre (theme.js) - téléphone et tablette
   seulement. Au-dessus de 1300px il n'existe pas : YumeList y reste en
   thème sombre, qui est le thème de référence du design. C'est aussi
   pour ça que theme.js force le sombre au bureau - sans bouton, un
   écran réglé en clair n'aurait aucun moyen d'en sortir.
   ------------------------------------------------------------ */
.ym-theme-sw { display: none; }

@media (max-width: 1299px) {
  .ym-theme-sw {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-shrink: 0; padding: 0; border: 0; background: none;
    color: var(--text-2); cursor: pointer; font: 500 13.5px var(--font-body);
  }
  .ym-theme-sw__txt { display: none; }

  /* La glissière : deux icônes fixes, un galet qui passe de l'une à l'autre. */
  .ym-theme-sw__track {
    position: relative; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: space-between;
    width: 54px; height: 30px; padding: 0 7px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-2); background: var(--glass);
    transition: background .32s var(--ease), border-color .32s var(--ease);
  }
  .ym-theme-sw:hover .ym-theme-sw__track { border-color: var(--sakura-line); }
  .ym-theme-sw:focus-visible .ym-theme-sw__track { outline: 2px solid var(--sakura); outline-offset: 3px; }

  .ym-theme-sw__ico {
    position: relative; z-index: 2; width: 13px; height: 13px; flex-shrink: 0;
    transition: color .32s var(--ease), opacity .32s var(--ease), transform .32s var(--ease);
  }
  /* Le galet se pose sur l'icône du thème AFFICHÉ : sombre, il est à gauche,
     sur la lune ; clair, il passe à droite, sur le soleil (lune à gauche dans
     le HTML des 5 pages). Il était sur l'icône de l'autre thème, ce qui se
     lisait à l'envers (signalé le 2026-09-30).
     Chaque icône se colore d'après ce qu'elle a DERRIÈRE elle : celle que le
     galet recouvre doit trancher sur le galet, l'autre sur la glissière. */
  .ym-theme-sw__moon { color: var(--ink); }      /* sous le galet clair */
  .ym-theme-sw__sun  { color: var(--text-2); }   /* sur la glissière */
  :root[data-theme="light"] .ym-theme-sw__moon { color: var(--sakura-deep); }
  :root[data-theme="light"] .ym-theme-sw__sun  { color: var(--white); }

  /* Le galet. Le léger étirement pendant la course donne la sensation
     d'élan d'un vrai interrupteur, au lieu d'un carré qui se téléporte. */
  .ym-theme-sw__knob {
    position: absolute; z-index: 1; top: 50%; left: 3px;
    width: 22px; height: 22px; margin-top: -11px;
    border-radius: 50%; background: var(--text-2);
    transition: transform .34s var(--ease), background .32s var(--ease), width .34s var(--ease);
  }
  :root[data-theme="light"] .ym-theme-sw__track { background: var(--sakura-soft); border-color: var(--sakura-line); }
  :root[data-theme="light"] .ym-theme-sw__knob { transform: translateX(24px); background: var(--sakura-deep); }
  .ym-theme-sw:active .ym-theme-sw__knob { width: 26px; }
  :root[data-theme="light"] .ym-theme-sw:active .ym-theme-sw__knob { transform: translateX(20px); }

  @media (prefers-reduced-motion: reduce) {
    .ym-theme-sw__knob, .ym-theme-sw__track, .ym-theme-sw__ico { transition: none; }
  }
}

/* Fondu de toute la page pendant la bascule (View Transitions).
   Sans prise en charge, le changement est instantané : rien ne casse. */
::view-transition-old(root), ::view-transition-new(root) {
  animation-duration: .3s; animation-timing-function: var(--ease);
}

/* ============================================================
   7. BOUTONS
============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--r-ctrl);
  font: 500 13.5px/1 var(--font-body); letter-spacing: .01em;
  white-space: nowrap; cursor: pointer;
  transition: transform .3s var(--ease), background .25s ease, border-color .25s ease, color .25s ease;
}
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; }

/* Sceau : le bouton principal porte un double filet, comme un tampon hanko.
   Le premier anneau reprend le fond (--sceau-fond), le second dessine le filet. */
.btn-sakura, .af-btn-accent {
  --sceau-fond: var(--sakura-deep);
  box-shadow: inset 0 0 0 3px var(--sceau-fond), inset 0 0 0 4px var(--sceau-filet);
}
.btn-sakura { background: var(--sakura-deep); color: #fff; }
.btn-sakura:hover:not(:disabled) { --sceau-fond: var(--sakura-deep-2); background: var(--sakura-deep-2); transform: translateY(-2px); }

.btn-ghost { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--glass-2); border-color: var(--text-3); transform: translateY(-2px); }

.btn-sm { height: 34px; padding: 0 15px; font-size: 12.5px; }
.btn-lg { height: 50px; padding: 0 28px; font-size: 14.5px; }

/* Boutons secondaires historiques (pages non refondues → refondues) */
.af-btn-accent {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px; border-radius: var(--r-ctrl);
  background: var(--sakura-deep); color: #fff; border: none;
  font: 500 13px/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: background .25s ease, transform .3s var(--ease);
}
.af-btn-accent:hover { --sceau-fond: var(--sakura-deep-2); background: var(--sakura-deep-2); transform: translateY(-2px); }
.af-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px; border-radius: var(--r-ctrl);
  background: transparent; border: 1px solid var(--border-2); color: var(--text-2);
  font: 500 13px/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.af-btn-ghost:hover { background: var(--glass-2); color: var(--text); border-color: var(--text-3); }

/* ============================================================
   8. PASTILLES & PUCES
============================================================ */
.af-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: 500 12.5px/1 var(--font-body);
  padding: 9px 15px; border-radius: var(--r-ctrl); white-space: nowrap;
  border: 1px solid var(--border-2); background: transparent; color: var(--text-2);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.af-chip.active { border-color: var(--sakura-line); background: var(--sakura-soft); color: var(--sakura); }

/* Fleur de sakura devant ce qui est choisi (celle du code OTP, en masque : elle prend
   la couleur du texte). Elle éclot en tournant d'un pétale. Les pages ajoutent leurs
   propres éléments au sélecteur dans leur feuille (index.css, recap.css). */
.af-chip.active::before {
  content: ''; width: 14px; height: 14px; margin-left: -2px; flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--fleur) center / contain no-repeat; mask: var(--fleur) center / contain no-repeat;
  animation: ym-eclosion .45s var(--ease) both;
}
@keyframes ym-eclosion { from { transform: scale(0) rotate(-72deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .af-chip.active::before { animation: none; } }

.af-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--font-body); letter-spacing: .04em;
  padding: 6px 12px; border-radius: var(--r-ctrl);
  background: var(--sakura-soft); border: 1px solid var(--sakura-line); color: var(--sakura);
}
/* Sur papier, --sakura tombe à 4,2:1 dans son propre voile (11px : il faut 4,5) */
:root[data-theme="light"] .af-pill,
:root[data-theme="light"] .af-chip.active { color: var(--sakura-2); }

/* ============================================================
   9. CHAMPS
============================================================ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 8px;
  font: 500 13px/1.35 var(--font-body); letter-spacing: 0;
  color: var(--text-2);
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  color: var(--text);
  font: 400 14px var(--font-body);
  padding: 12px 15px;
  outline: none;
  transition: border-color .2s ease, background .2s ease;
}
.form-input:hover, .form-select:hover, .form-textarea:hover { border-color: var(--text-3); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--sakura-line); background: var(--ink-2);
}
.form-select { cursor: pointer; }
.form-select option { background: var(--ink-2); color: var(--text); }
.form-textarea { line-height: 1.7; resize: vertical; min-height: 120px; }

.form-error   { color: var(--red);   font: 400 12.5px var(--font-body); margin-top: 10px; }
.form-success { color: var(--green); font: 400 12.5px var(--font-body); margin-top: 10px; }

/* ============================================================
   10. MODALES
============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--overlay);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: ymFade .22s ease;
}
@keyframes ymFade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  background: var(--ink-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
  animation: ymModalIn .34s var(--ease-out);
}
@keyframes ymModalIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 28px 18px;
  flex-shrink: 0;
}
.modal-title {
  font: 500 21px/1.3 var(--font-jp); color: var(--text); letter-spacing: -.01em;
}
.modal-close {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer; font-size: 15px; flex-shrink: 0;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.modal-close:hover { color: var(--text); border-color: var(--text-3); background: var(--glass); }

.modal-body { padding: 8px 28px 26px; overflow-y: auto; }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ============================================================
   11. TOASTS
============================================================ */
.toast-container {
  position: fixed; bottom: 28px; right: 28px; z-index: 500;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 340px;
  padding: 14px 18px;
  background: var(--ink-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  font: 400 13px var(--font-body); color: var(--text);
  pointer-events: all;
  animation: ymToastIn .35s var(--ease-out);
}
@keyframes ymToastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
.toast::before {
  content: ''; width: 3px; align-self: stretch; border-radius: 2px; flex-shrink: 0;
  background: var(--sakura);
}
.toast__text { flex: 1; min-width: 0; }
/* Action facultative dans un message : « Annuler » après une suppression. */
.toast__action {
  flex-shrink: 0; height: 27px; padding: 0 12px; border-radius: var(--r-ctrl);
  border: 1px solid var(--sakura-line); background: transparent;
  font: 500 11.5px var(--font-body); color: var(--sakura); cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.toast__action:hover { background: var(--sakura-deep); color: #fff; border-color: transparent; }
.toast.success::before { background: var(--green); }
.toast.error::before   { background: var(--red); }
.toast.info::before    { background: var(--sakura); }

/* ============================================================
   11 bis. NOTIFICATIONS - cloche de la barre, pop-ups, badge débloqué
   Partagés par les pages d'un membre (index, anime, profile, showcase) :
   frontend/notifications.js. Venus d'index.css le 2026-10-01, quand les
   notifications ont quitté la seule page d'accueil.
============================================================ */
/* Cloche des notifications (barre des membres) */
.ym-bell { position: relative; }
.ym-bell__btn { position: relative; width: 34px; padding: 0 !important; justify-content: center; }
.ym-bell__btn .ico { width: 17px; height: 17px; }
.ym-bell__count {
  position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--sakura-deep); color: #fff;
  font: 600 10.5px/18px var(--font-body); text-align: center; font-variant-numeric: tabular-nums;
}
.ym-bell__count[hidden] { display: none; }
.ym-bell__panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 380px;
  background: var(--ink-2); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); overflow: hidden;
}
.ym-bell__panel[hidden] { display: none; }
.ym-bell__head { padding: 14px 18px 12px; border-bottom: 1px solid var(--border); font: 500 16px var(--font-jp); color: var(--text); }
.ym-bell__list { max-height: min(460px, 70vh); overflow-y: auto; }
.ym-bell__empty { margin: 0; padding: 22px 18px; font: 400 13px var(--font-body); color: var(--text-2); }
.ym-notif {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%;
  padding: 12px 18px; border: none; border-bottom: 1px solid var(--border); background: none;
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.ym-notif:last-child { border-bottom: none; }
.ym-notif:hover, .ym-notif:focus-visible { background: var(--glass); }
.ym-notif.is-new { background: var(--sakura-soft); }
.ym-notif__visuel {
  width: 34px; height: 34px; border-radius: var(--r-xs); overflow: hidden; background: var(--ink-3);
  display: flex; align-items: center; justify-content: center; color: var(--sakura);
}
.ym-notif__visuel img { width: 100%; height: 100%; object-fit: cover; }
.ym-notif__visuel .ico { width: 17px; height: 17px; }
.ym-notif__corps { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ym-notif__texte { font: 400 13px/1.45 var(--font-body); color: var(--text-2); }
.ym-notif__texte strong { color: var(--text); font-weight: 600; }
.ym-notif.is-new .ym-notif__texte { color: var(--text); }
.ym-notif__date { font: 400 11.5px var(--font-body); color: var(--text-3); }
@media (max-width: 1299px) {
  .ym-bell__panel { position: fixed; top: 72px; left: 16px; right: 16px; width: auto; }
}

/* Pop-up d'une notification (même emplacement que les badges) */
.ym-notif-pop {
  position: relative; pointer-events: all; cursor: pointer;
  display: flex; align-items: center; gap: 14px; text-align: left;
  width: 380px; max-width: calc(100vw - 32px); padding: 14px 18px;
  background: var(--ink-2); border: 1px solid var(--sakura-line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); font: inherit; color: inherit;
  animation: ymBadgeIn .5s var(--ease-out) forwards;
}
.ym-notif-pop.hiding { animation: ymBadgeOut .4s ease-in forwards; }
.ym-notif-pop .ym-notif__visuel { width: 40px; height: 40px; }
.ym-notif-pop__corps { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ym-notif-pop__label { font: 600 11px var(--font-body); color: var(--sakura); }
.ym-notif-pop__texte { font: 400 13.5px/1.45 var(--font-body); color: var(--text-2); }
.ym-notif-pop__texte strong { color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .ym-notif-pop { width: calc(100vw - 32px); } }

/* Proposer les notifications sur cet appareil (notifications.js) : ligne en
   tête de la cloche, carte après « Être prévenu » (emplacement des pop-ups) */
.ym-bell__push {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--border); background: var(--glass);
}
.ym-bell__push-texte { flex: 1; min-width: 0; margin: 0; font: 400 13px/1.45 var(--font-body); color: var(--text-2); }
.ym-bell__push .btn { flex: none; }
.ym-bell__push-x {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: none; border-radius: var(--r-ctrl);
  background: none; color: var(--text-3); cursor: pointer;
}
.ym-bell__push-x:hover, .ym-bell__push-x:focus-visible { background: var(--glass-2); color: var(--text); }
.ym-bell__push-x .ico { width: 15px; height: 15px; }
.ym-push-carte {
  position: relative; pointer-events: all;
  display: flex; align-items: flex-start; gap: 14px;
  width: 380px; max-width: calc(100vw - 32px); padding: 16px 18px;
  background: var(--ink-2); border: 1px solid var(--sakura-line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  animation: ymBadgeIn .5s var(--ease-out) forwards;
}
.ym-push-carte.hiding { animation: ymBadgeOut .4s ease-in forwards; }
.ym-push-carte .ym-notif__visuel { flex: none; width: 40px; height: 40px; }
.ym-push-carte__corps { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ym-push-carte__titre { margin: 0; font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text); }
.ym-push-carte__texte { margin: 0; font: 400 13.5px/1.45 var(--font-body); color: var(--text-2); }
.ym-push-carte__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@media (max-width: 560px) { .ym-push-carte { width: calc(100vw - 32px); } }

/* Badge débloqué : pop-up doré centré en bas, avec son sceau */
.badge-notif-container { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.badge-notif {
  position: relative; overflow: hidden; pointer-events: all;
  display: flex; align-items: center; gap: 16px;
  min-width: 320px; max-width: 400px; padding: 16px 22px;
  background: var(--ink-2); border: 1px solid rgba(201,150,58,.5); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  animation: ymBadgeIn .5s var(--ease-out) forwards; cursor: pointer;
}
.badge-notif.hiding { animation: ymBadgeOut .4s ease-in forwards; }
@keyframes ymBadgeIn  { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes ymBadgeOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(16px) scale(.94); } }
.badge-notif-icon {
  width: 54px; height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font: 600 27px/1 var(--font-jp); color: var(--sakura);
  background: rgba(232,84,122,.08);
  border: 1.5px solid rgba(232,84,122,.85); border-radius: 12px;
  box-shadow: inset 0 0 0 3px var(--ink-2), inset 0 0 0 4px rgba(232,84,122,.3);
  animation: ymBadgePop .6s var(--ease-out) .2s both;
}
@keyframes ymBadgePop { from { transform: scale(1.6) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(-4deg); opacity: 1; } }
.badge-notif-body { flex: 1; min-width: 0; }
.badge-notif-label { font: 600 11px var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.badge-notif-name { font: 500 17px/1.3 var(--font-jp); color: var(--text); margin-bottom: 3px; }
.badge-notif-desc { font: 400 12.5px/1.5 var(--font-body); color: var(--text-2); }
.badge-notif-shine { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent 30%, rgba(201,150,58,.1) 50%, transparent 70%); animation: ymShine 1.5s ease .3s forwards; pointer-events: none; }
@keyframes ymShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.badge-notif-particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.badge-particle { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); opacity: 0; animation: ymParticle var(--dur) ease-out var(--delay) forwards; }
@keyframes ymParticle { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0); } }

/* ============================================================
   12. ÉTATS
============================================================ */
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-2);
  border-top-color: var(--sakura);
  animation: ymSpin .7s linear infinite;
}
@keyframes ymSpin { to { transform: rotate(360deg); } }

.af-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; min-height: 60vh;
  color: var(--text-3); font: 400 13px var(--font-body);
}

.empty-state { text-align: center; padding: 80px 24px; color: var(--text-3); }
.empty-jp {
  font: 300 clamp(48px, 8vw, 80px)/1 var(--font-jp);
  color: var(--ink-4); margin-bottom: 22px; letter-spacing: .1em;
}
.empty-title { font: 500 var(--fs-sub)/1.4 var(--font-jp); color: var(--text-2); margin-bottom: 10px; }
.empty-sub { font: 400 13.5px/1.7 var(--font-body); color: var(--text-3); max-width: 42ch; margin: 0 auto; }

/* Avatar rond - partagé profil / vitrine / listes */
.af-avatar-circle {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--ink-3);
}
.af-avatar-circle svg, .af-avatar-circle img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Marqueur pour la distorsion WebGL au survol (motion.js) - aucun
   style propre, uniquement une accroche. */
.ym-cover { position: relative; }

/* Plaque d'affiche : posée sous l'<img> (qui la recouvre une fois chargée).
   Si l'image manque ou échoue (onerror la masque), la carte garde une
   affiche composée - initiale en serif dans un cadre à filet - au lieu
   d'un trou ou d'un texte alternatif peint par-dessus la carte. */
.ym-plate {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink-3);
  font: 500 clamp(34px, 4vw, 56px)/1 var(--font-jp); color: var(--text-3);
  pointer-events: none; user-select: none;
}
.ym-plate::before {
  content: ''; position: absolute; inset: 8px;
  border: 1px solid var(--border-2); border-radius: 8px;
}
.ym-plate--sm { font-size: 17px; }
.ym-plate--sm::before { inset: 3px; border-radius: 3px; }

/* Sceau 完 d'une série terminée (sceau-termine.js) : posé sur une affiche,
   il reste rose et blanc dans les deux thèmes. Par défaut accroché à droite,
   taille proportionnelle au support ; chaque page ajuste sa place. */
.ym-kan { position: absolute; z-index: 4; right: 8%; top: 36%; width: clamp(44px, 30%, 96px); aspect-ratio: 1; pointer-events: none; }
.ym-kan svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ym-kan__fond { fill: var(--sakura-deep); }
.ym-kan__filet { fill: none; stroke: var(--sceau-filet); stroke-width: 1.4; }
.ym-kan__car { fill: var(--white); font: 600 30px var(--font-jp); }
.ym-kan__aureole { fill: none; stroke: var(--sakura); stroke-width: 2; }

/* Entrée au scroll (motion.js) : le contenu reste visible si GSAP
   ne charge pas - l'animation ne fait que l'affiner. Au bureau seulement :
   sur téléphone (version légère), un calque permanent par carte pèserait
   lourd en mémoire graphique (300 pour une liste de 300 animes). */
@media (hover: hover) and (min-width: 1300px) {
  [data-reveal] { will-change: transform, opacity; }
}

/* ============================================================
   13. EFFETS PARTAGÉS - mécanismes repris de Magic UI, redessinés en
   CSS pur dans les jetons du site (aucune dépendance). Le JS (motion.js)
   ne fait que poser des variables ou des classes.
============================================================ */

/* Spotlight (magic-card) : halo sakura qui suit le curseur. */
.ym-spot { position: relative; }
.ym-spot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, -999px) var(--my, -999px), rgba(232,84,122,.13), transparent 65%);
  opacity: 0; transition: opacity .35s ease;
}
.ym-spot:hover::after { opacity: 1; }

/* Border beam : un éclat sakura→or qui parcourt le contour d'un seul
   élément focal par page. */
@property --ym-beam { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ym-beam { position: relative; }
.ym-beam::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ym-beam), transparent 0deg, transparent 290deg, var(--sakura) 325deg, var(--gold) 348deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: ymBeam 7s linear infinite;
}
@keyframes ymBeam { to { --ym-beam: 360deg; } }

/* Progression de lecture (scroll-progress). */
.ym-scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 101; width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--sakura), var(--gold));
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}

/* Compteurs (number-ticker) : chiffres tabulaires pour que la largeur
   ne saute pas pendant le comptage. */
[data-ticker] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .ym-beam::before { animation: none; }
  .ym-spot::after { display: none; }
}

/* ============================================================
   14. RESPONSIVE
============================================================ */
/* Seuil de la navigation : la barre complète de l'app a besoin d'environ
   1300px (logo + 7 liens + bloc compte). En dessous, les liens passaient
   par-dessus le pseudo et les boutons - d'où la feuille descendante dès
   1299px, qui couvre aussi les tablettes larges (iPad Pro 13" : 1032px). */
@media (max-width: 1299px) {
  /* Une seule rangée : marque + hamburger. Sections et compte passent dans
     la feuille descendante, qui recouvre la page au lieu de la pousser. */
  .nav { height: 62px; column-gap: 12px; }
  .nav-logo img { height: 30px; }
  .nav-burger {
    display: flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex-shrink: 0; margin-left: auto;
    border: 1px solid var(--border-2); border-radius: var(--r-md);
    background: transparent; color: var(--text); cursor: pointer; padding: 0;
    transition: border-color .2s ease, background .2s ease;
  }
  .nav-burger:hover, .nav.is-menu-open .nav-burger { border-color: var(--sakura); background: var(--ink-2); }
  .nav-burger .ico { width: 20px; height: 20px; }
  .nav-burger__cross, .nav.is-menu-open .nav-burger__bars { display: none; }
  .nav.is-menu-open .nav-burger__cross { display: block; }

  .nav-sheet {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; max-height: calc(100dvh - 62px); overflow-y: auto;
    /* opaque : le parent .nav porte déjà un backdrop-filter, un second n'est
       pas réappliqué au fond de cet enfant - le texte de la page transparaissait */
    background: var(--ink); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-2);
  }
  .nav.is-menu-open .nav-sheet { display: flex; animation: navSheetIn .22s var(--ease); }
  @keyframes navSheetIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

  .nav-links { flex-direction: column; align-items: stretch; gap: 0; overflow: visible; }
  .nav-links a {
    padding: 15px var(--gutter); font-size: 15px; border-top: 1px solid var(--border);
    border-left: 2px solid transparent;
  }
  .nav-links a:first-child { border-top: none; }
  .nav-links a.active { color: var(--sakura); border-left-color: var(--sakura); background: var(--ink-2); }
  .nav-links a::after { display: none; }
  #navIndicator { display: none; }

  /* uniquement dans la feuille : profile/anime/showcase/admin gardent leur
     barre en ligne, elles n'ont pas de menu */
  .nav-sheet .nav-right {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 14px var(--gutter) 18px; border-top: 1px solid var(--border-2);
  }
  .nav-sheet .nav-right .btn { width: 100%; height: 44px; justify-content: center; font-size: 13.5px; }
  .nav-sheet .nav-right .af-pill { align-self: flex-start; }
  /* Dans la feuille du menu, l'interrupteur devient une ligne comme les
     autres : libellé à gauche, glissière à droite. */
  .nav-sheet > .ym-theme-sw {
    display: flex; width: auto; height: 44px; padding: 0 14px;
    margin: 0 var(--gutter) 18px;
    border: 1px solid var(--border-2); border-radius: var(--r);
  }
  .nav-sheet > .ym-theme-sw .ym-theme-sw__txt { display: inline; color: var(--text); }
}

@media (max-width: 1024px) {
  :root { --gutter: 20px; }
  .ym-panel { padding: 22px; border-radius: var(--r-lg); }
  .ym-head { margin-bottom: 28px; }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .nav { column-gap: 10px; }
  .nav-logo img { height: 27px; }
  /* Pages sans menu (profil, fiche, vitrine, admin) : .nav-right est enfant
     direct de .nav et doit rester compact. Dans la feuille du menu, au
     contraire, le pseudo et les boutons restent en grand. */
  .nav > .nav-right .af-pill { display: none; }
  .nav > .nav-right .btn { height: 32px; padding: 0 11px; font-size: 11.5px; flex-shrink: 0; }
  .modal-overlay { padding: 12px; }
  .modal { max-height: calc(100vh - 24px); border-radius: var(--r-lg); }
  .modal-header { padding: 20px 20px 14px; }
  .modal-body { padding: 6px 20px 20px; }
  .modal-footer { padding: 14px 20px 18px; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
  .toast { min-width: 0; max-width: none; }
}

/* Petits téléphones, pages sans menu (fiche, profil, vitrine) : loupe,
   cloche, Retour et interrupteur de thème ne tenaient plus à côté du logo -
   la barre débordait dès 360px avec la cloche des notifications
   (2026-10-01). « Retour » se réduit à sa flèche (le nom reste dans
   aria-label), les écarts se resserrent, et sous 360px le logo rapetisse. */
.nav-retour { gap: 5px; }
@media (max-width: 385px) {
  .nav > .nav-right { gap: 6px; }
  .nav > .nav-right .nav-retour { width: 34px; padding: 0; }
  .nav-retour__txt { display: none; }
}
@media (max-width: 359px) {
  .nav-logo img { height: 23px; }
}

/* ── Statistiques (stats-charts.js) : profil et vitrine publique ──
   Graphiques en HTML/CSS, sur les jetons du thème. */
.ym-stat { background: var(--ink-2); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 28px; min-width: 0; }
.ym-stat__head { margin-bottom: 20px; }
.ym-stat__head b { display: block; font: 500 19px/1.3 var(--font-jp); color: var(--text); }
.ym-stat__head span { display: block; margin-top: 5px; font: 400 12.5px/1.6 var(--font-body); color: var(--text-3); }
/* Genres (haut) à gauche, notes et formats empilés à droite, activité dessous */
.ym-stats {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
  grid-template-areas: "genres notes" "genres formats" "activite activite";
}
.ym-stat--genres { grid-area: genres; }
.ym-stat--notes { grid-area: notes; }
.ym-stat--formats { grid-area: formats; }
.ym-stat--activite { grid-area: activite; }
.ym-stat__vide { padding: 26px 10px 18px; text-align: center; }
.ym-stat__vide .empty-jp { display: block; font-size: 32px; margin-bottom: 10px; }
.ym-stat__vide p { font: 400 13px/1.6 var(--font-body); color: var(--text-3); max-width: 40ch; margin: 0 auto; }

/* Barres horizontales : 14px d'épaisseur, bout arrondi, départ carré */
.ym-bars { display: flex; flex-direction: column; gap: 4px; }
.ym-bars__row {
  display: grid; grid-template-columns: minmax(84px, 30%) minmax(0, 1fr) 34px; align-items: center; gap: 12px;
  padding: 5px 6px; margin: 0 -6px; border-radius: var(--r-xs); outline: none; cursor: default;
}
.ym-bars__row:hover, .ym-bars__row:focus-visible { background: var(--veil); }
.ym-bars__row:focus-visible { box-shadow: 0 0 0 2px var(--sakura); }
.ym-bars__label { font: 400 13px var(--font-body); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-bars__track { height: 14px; display: flex; align-items: center; }
.ym-bars__bar { height: 100%; background: var(--sakura); border-radius: 0 4px 4px 0; transform-origin: left; animation: ym-bar-in .6s cubic-bezier(.2,.7,.2,1) both; }
.ym-bars__val { font: 500 12.5px var(--font-body); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

/* Colonnes : 24px au plus, chapeau arrondi, ligne de base en filet */
.ym-cols { display: flex; align-items: stretch; gap: 4px; height: 190px; padding-top: 22px; }
.ym-cols__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; border-radius: var(--r-xs); outline: none; }
.ym-cols__col:hover, .ym-cols__col:focus-visible { background: var(--veil); }
.ym-cols__col:focus-visible { box-shadow: 0 0 0 2px var(--sakura); }
.ym-cols__plot { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--border-2); }
.ym-cols__bar { position: relative; width: min(24px, 70%); background: var(--sakura); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: ym-col-in .6s cubic-bezier(.2,.7,.2,1) both; }
.ym-cols__val { position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); font: 500 11.5px var(--font-body); color: var(--text); white-space: nowrap; }
.ym-cols__label { font: 400 11.5px var(--font-body); color: var(--text-3); padding-bottom: 4px; white-space: nowrap; }
@keyframes ym-bar-in { from { transform: scaleX(0); } }
@keyframes ym-col-in { from { transform: scaleY(0); } }
@media (prefers-reduced-motion: reduce) { .ym-bars__bar, .ym-cols__bar { animation: none; } }

.ym-stat-tip {
  position: fixed; z-index: 1000; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px; padding: 8px 11px;
  background: var(--ink-3); border: 1px solid var(--border-2); border-radius: var(--r-xs);
  box-shadow: var(--shadow-2); font: 400 12px/1.4 var(--font-body); color: var(--text-2);
  opacity: 0; transition: opacity .12s ease;
}
.ym-stat-tip.is-on { opacity: 1; }
.ym-stat-tip b { font-weight: 600; color: var(--text); }

@media (max-width: 900px) {
  .ym-stats { grid-template-columns: minmax(0, 1fr); grid-template-areas: "genres" "notes" "activite" "formats"; }
}
@media (max-width: 560px) {
  .ym-stat { padding: 22px 18px; }
  .ym-cols__val { font-size: 10.5px; }
  .ym-cols__label { font-size: 10.5px; }
}


/* ================================================================
   RECHERCHE D'UN ANIME DEPUIS TOUTE PAGE (recherche-globale.js)
   Loupe dans la barre (index, fiche anime, vitrine), panneau sous la barre.
   ================================================================ */
.ym-gs-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 34px; height: 34px; padding: 0; border-radius: var(--r-ctrl);
  border: 1px solid var(--border-2); background: transparent; color: var(--text-2);
  cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.ym-gs-btn:hover, .ym-gs-btn:focus-visible { color: var(--text); border-color: var(--sakura-line); }
.ym-gs-btn svg { width: 16px; height: 16px; }

.ym-gs {
  position: fixed; inset: 0; z-index: 300;
  padding: 88px var(--gutter) 24px;
  background: var(--overlay); backdrop-filter: blur(6px);
  animation: ymFade .18s ease;
}
.ym-gs[hidden] { display: none; }
body.ym-gs-ouvert { overflow: hidden; }
.ym-gs__boite {
  max-width: 600px; margin: 0 auto; overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
}
.ym-gs__tete { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); }
.ym-gs__loupe { display: inline-flex; color: var(--text-3); }
.ym-gs__loupe svg { width: 18px; height: 18px; }
.ym-gs__champ {
  flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent;
  color: var(--text); font: 400 16px var(--font-body);
}
.ym-gs__champ::placeholder { color: var(--text-3); }
.ym-gs__champ::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.ym-gs__fermer {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: var(--r-ctrl);
  background: transparent; color: var(--text-3); cursor: pointer;
}
.ym-gs__fermer:hover, .ym-gs__fermer:focus-visible { color: var(--text); background: var(--ink-3); }
.ym-gs__fermer svg { width: 16px; height: 16px; }
.ym-gs__etat { padding: 14px 18px; font: 400 13px/1.5 var(--font-body); color: var(--text-3); }
.ym-gs__etat:empty { display: none; }
.ym-gs__liste { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 520px); overflow-y: auto; }
.ym-gs__liste:empty { display: none; }
.ym-gs__item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-xs); cursor: pointer; }
.ym-gs__item[aria-selected="true"] { background: var(--ink-3); }
.ym-gs__affiche {
  position: relative; flex-shrink: 0; width: 34px; height: 48px; overflow: hidden;
  border-radius: 4px; background: var(--ink-3);
}
.ym-gs__affiche::before {
  content: attr(data-initiale); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font: 400 15px var(--font-jp); color: var(--text-3);
}
.ym-gs__affiche img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.ym-gs__textes { display: flex; flex-direction: column; min-width: 0; }
.ym-gs__titre { font: 500 14px/1.3 var(--font-body); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ym-gs__meta { margin-top: 2px; font: 400 12px var(--font-body); color: var(--text-3); }
@media (max-width: 620px) {
  .ym-gs { padding: 72px 10px 16px; }
  .ym-gs__liste { max-height: calc(100vh - 170px); }
}
