/* Encres Riso du ciné (Bright Red, Fluorescent Pink, Black) sur papier crème ; police TGL de cyberclef.org,
   pointillés, un peu d'ASCII.
   Esprit programme de ciné / fanzine : angles droits, cadres en pointillés, machine à écrire
   pour ce qu'on saisit. */
/* Le « @ » des polices TGL ressemble à un alpha : on l'exclut (unicode-range sans U+0040),
   il est alors dessiné par la police suivante de la liste. */
@font-face { font-family: "TGL2"; src: url("/static/fonts/tgl2.ttf");
             unicode-range: U+0000-003F, U+0041-10FFFF; }
@font-face { font-family: "TGL"; src: url("/static/fonts/tgl.ttf");
             unicode-range: U+0000-003F, U+0041-10FFFF; }
/* Pixelify Sans (licence OFL, fonts/pixelify-OFL.txt) : la voix du chat dans ses bulles */
@font-face { font-family: "Pixelify Sans"; src: url("/static/fonts/pixelify.ttf"); font-weight: 400 700; }

:root {
  --principal: #f15060;        /* encre Riso Bright Red (185 U) : bandeau, cadres, aplats */
  --principal-texte: #c0303f;  /* le même rouge, assombri pour le texte sur papier clair */
  --principal-voile: #f150601f;
  --sur-principal: #000;       /* texte sur le rouge : noir (le blanc manque de contraste) */
  --clair: #f7f5e6;
  --fond: #f7f5e6;             /* papier crème */
  --papier: #fffdf3;
  --encre: #111;               /* encre Riso Black */
  --encre-douce: #6b6560;
  --trait: #f15060b3;
  --sapin: #2f6f5e;
  --soleil: #ff48b066;         /* surligné de l'historique */
  --ombre: #000;
  --bouton: #111;              /* boutons pleins : noirs, ombre rose fluo décalée */
  --sur-bouton: #f7f5e6;
  /* Encre Riso Fluorescent Pink (806 U) : films, dates, ombre des boutons (calage).
     Elle manque de contraste en petit texte : fonds, traits et ombres ; --rose-texte pour écrire. */
  --rose: #ff48b0;
  --rose-texte: #c2187a;
  --date: #ff48b0;
  --sur-date: #000;

  --titre-font: "TGL2", "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  --em-font: "TGL", "Avenir Next", "Trebuchet MS", Arial, sans-serif;
  --machine: "Courier Prime", "Courier New", ui-monospace, Menlo, monospace;
  --chat-font: "Pixelify Sans", var(--titre-font);
  color-scheme: light;
}

/* Thème sombre : noir de salle, mêmes encres ; le bandeau reste rouge.
   Choix enregistré (bouton du bandeau), sinon réglage du système */
:root[data-theme="dark"] {
  --principal-texte: #ff7a86;
  --principal-voile: #f1506026;
  --fond: #121212;
  --papier: #1c1c1c;
  --encre: #f7f5e6;
  --encre-douce: #a8a39b;
  --trait: #f1506099;
  --sapin: #7fd3b8;
  --soleil: #ff48b055;
  --ombre: #000;
  --bouton: #f7f5e6;           /* sur fond noir, les boutons « noirs » passent en crème */
  --sur-bouton: #111;
  --rose-texte: #ff7cc8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --principal-texte: #ff7a86;
    --principal-voile: #f1506026;
    --fond: #121212;
    --papier: #1c1c1c;
    --encre: #f7f5e6;
    --encre-douce: #a8a39b;
    --trait: #f1506099;
    --sapin: #7fd3b8;
    --soleil: #ff48b055;
    --ombre: #000;
    --bouton: #f7f5e6;           /* sur fond noir, les boutons « noirs » passent en crème */
    --sur-bouton: #111;
    --rose-texte: #ff7cc8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--fond);
       color: var(--encre); font-family: var(--titre-font); line-height: 1.4; }
a { color: var(--principal-texte); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--titre-font); font-weight: normal; line-height: 1.1; }
::selection { background: var(--principal); color: var(--sur-principal); }

/* --- Bandeau --- */
/* Bandeau plein Bright Red, comme une tête d'affiche ; tout y est écrit en noir */
.bandeau { background: var(--principal); color: #000; }
.bandeau .in { max-width: 1320px; margin: 0 auto; padding: 18px 32px 14px; display: flex;
               align-items: baseline; gap: 28px; }
.marque { font-size: 1.7rem; color: #000; text-decoration: none; white-space: nowrap; }
.marque small { font-family: var(--em-font); font-size: .95rem; margin-left: 8px; color: var(--encre-douce); }
.nav { display: flex; gap: 22px; flex: 1; }
.nav a { color: #000; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.nav a:hover { text-decoration: underline; }
.nav a.actif { color: #000; text-decoration: underline wavy #000;
               text-underline-offset: 6px; }
.qui { display: flex; align-items: baseline; gap: 14px; font-size: .95rem; color: #000; }
.qui form { margin: 0; }
.qui button, .theme { font: inherit; color: #000; background: none; border: none; padding: 0;
                      cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.qui button:hover, .theme:hover { color: var(--clair); }
.theme { text-decoration: none; font-size: 1.15rem; }
.badge-admin { font-family: var(--em-font); color: #000; }
.badge-admin::before { content: "["; } .badge-admin::after { content: "]"; }
/* Tampon « base de dev » */
.badge-base { align-self: center; font-family: var(--em-font); font-size: .78rem; text-transform: uppercase;
              letter-spacing: .08em; color: #000; border: 2px solid currentColor;
              padding: 1px 8px; transform: rotate(-3deg); white-space: nowrap; }

main { max-width: 1320px; width: 100%; margin: 0 auto; padding: 36px 32px 80px; flex: 1; }
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
          margin-bottom: 34px; }
.entete h1 { font-size: 2.6rem; margin: 4px 0 0; color: var(--principal); }
.entete .sous { color: var(--encre-douce); margin: 8px 0 0; font-family: var(--em-font); }
.entete .equipe { margin-left: 12px; font-family: var(--chat-font); font-variant-ligatures: none;
                  font-style: normal; color: var(--encre); }
.fil { font-size: .95rem; margin-bottom: 6px; }
.fil a { text-decoration: none; }

/* --- Bannière ASCII de la page de connexion (police figlet « cola », comme cyberclef.org) --- */
.accueil-ascii { text-align: center; color: var(--principal); margin: 4vh 0 0; overflow: hidden; }
.ascii { display: inline-block; text-align: left; margin: 0; font-family: var(--machine);
         font-size: clamp(4px, 1.3vw, 18px); line-height: 1.15; color: var(--rose); }

/* --- Le chat à la clé (sprite 16×19, agrandi sans flou) --- */
.chat { width: 32px; height: 38px; image-rendering: pixelated; vertical-align: middle; }
/* Thème sombre : le chat noir se perdrait sur le fond, on le détoure en crème */
:root[data-theme="dark"] .chat { filter: drop-shadow(1px 0 0 #fbf1f4) drop-shadow(-1px 0 0 #f7f5e6)
  drop-shadow(0 1px 0 #fbf1f4) drop-shadow(0 -1px 0 #fbf1f4); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chat { filter: drop-shadow(1px 0 0 #fbf1f4) drop-shadow(-1px 0 0 #f7f5e6)
    drop-shadow(0 1px 0 #fbf1f4) drop-shadow(0 -1px 0 #fbf1f4); }
}
.vide .chat { margin-right: 6px; vertical-align: -10px; }
.banniere { display: inline-flex; align-items: flex-end; gap: 10px; }
.chat-banniere { width: clamp(32px, 4.4vw, 64px); height: auto; margin-bottom: 4px; }
.chat-erreur { display: block; width: 48px; height: 57px; margin: 0 0 14px; }
/* Pendant un envoi : le chat remplace l'attente silencieuse */
.chat-attente { display: none; width: 32px; height: 38px; }
body.occupe .chat-attente { display: inline-block; animation: sautille .5s steps(2) infinite alternate; }
.etat-bloc { display: inline-flex; align-items: center; gap: 10px; }
.connexion form .chat-attente { justify-self: center; }
@keyframes sautille { to { transform: translateY(-4px); } }

/* Page Crédits : la photo de Nocturne apparaît au survol (ou au toucher) de son nom */
.nocturne { position: relative; color: var(--rose-texte); text-decoration: underline dotted; cursor: help; }
.nocturne-photo { position: absolute; left: 0; bottom: calc(100% + 10px); width: 220px; height: auto; z-index: 20;
                  border: 6px solid var(--papier); box-shadow: 4px 4px 0 var(--rose); transform: rotate(-3deg);
                  opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; }
.nocturne:hover .nocturne-photo, .nocturne:focus .nocturne-photo { opacity: 1; visibility: visible; }

/* --- Repères typographiques à la place des pastilles --- */
.type-film { color: var(--rose-texte); }
.compte { font-family: var(--machine); font-size: .9rem; color: var(--encre-douce); }
.compte::before { content: "("; } .compte::after { content: ")"; }
.requis { color: var(--principal-texte); margin-left: 2px; }
.vide { color: var(--encre-douce); font-family: var(--em-font); margin: 0; }

/* --- Messages --- */
.msg { padding: 10px 16px; margin: 0 0 26px; border: 2px solid; background: var(--papier); }
.msg.ok { border-color: var(--sapin); color: var(--sapin); }
.msg.ok::before { content: "✓ "; }
.msg.err { border-color: var(--principal-texte); color: var(--principal-texte); }
.msg.err::before, .msg.attention::before { content: "! "; font-weight: bold; }
.msg.attention { border-color: var(--principal); border-style: dashed; color: var(--encre); }
.msg ul { margin: 6px 0 0; padding-left: 20px; }

/* --- Sections : cadre en pointillés, titre posé sur le trait (façon fieldset) --- */
.carte { position: relative; border: 2px dashed var(--trait); padding: 30px 28px 24px;
         margin: 0 0 40px; }
.carte > h2 { position: absolute; top: -0.85em; left: 18px; margin: 0; padding: 0 10px;
              background: var(--fond); font-size: 1.45rem; color: var(--principal);
              display: flex; align-items: baseline; gap: 8px; }

/* --- Séances : comme une page de programme --- */
.seances { display: grid; }
.seance-ligne { display: grid; grid-template-columns: 250px 1fr auto; gap: 20px; align-items: baseline;
                padding: 12px 4px; border-top: 1px dashed var(--trait); text-decoration: none;
                color: inherit; }
.seance-ligne:first-child { border-top: none; }
.seance-ligne:hover { background: var(--principal-voile); }
.seance-ligne:hover .seance-titre { color: var(--principal-texte); }
.date { font-family: var(--machine); font-size: .92rem; }
.date .salle { display: block; color: var(--encre-douce); }
/* Dates à venir : tampon carmin */
.jour { padding: 1px 5px; }
.seance-ligne:not(.passee) .jour, .sous .jour { background: var(--date); color: var(--sur-date); }
.passee { color: var(--encre-douce); }
.seance-titre { font-size: 1.15rem; }
.seance-films { color: var(--encre-douce); font-family: var(--em-font); }
.seance-ligne .btn { visibility: hidden; }
.seance-ligne:hover .btn { visibility: visible; }
details.passees > summary { cursor: pointer; color: var(--encre-douce); margin: 18px 0 8px;
                            font-family: var(--em-font); }

/* --- Films --- */
.films { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 20px; }
.film-carte { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.film-carte .vignette { position: relative; overflow: hidden; aspect-ratio: 16 / 9;
                        border: 2px solid var(--rose); background: color-mix(in srgb, var(--rose) 14%, transparent);
                        display: flex; align-items: center; justify-content: center;
                        color: var(--rose-texte); font-size: 2.2rem; }
/* Même cadre pour toutes les images, affiches en portrait comprises */
.film-carte img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
                  filter: saturate(.85); transition: filter .15s; }
.film-carte:hover img { filter: none; }
.film-carte:hover .vignette { box-shadow: 4px 4px 0 var(--rose); }
.film-carte strong { display: block; font-weight: normal; font-size: 1.05rem; }
.film-carte:hover strong { color: var(--rose-texte); }
.film-carte .txt > span { font-family: var(--em-font); font-size: .88rem; color: var(--encre-douce); }

/* --- Table (vue admin) --- */
.outils { display: flex; gap: 18px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.onglets { display: flex; }
.onglets a { padding: 6px 18px; text-decoration: none; color: var(--principal-texte);
             border: 2px solid var(--principal); margin-right: -2px; }
.onglets a.actif { background: var(--principal); color: var(--sur-principal); }
table.liste { width: 100%; border-collapse: collapse; }
.liste th { text-align: left; font-weight: normal; font-family: var(--em-font); color: var(--encre-douce);
            padding: 8px 10px; border-bottom: 2px solid var(--principal); }
.liste td { padding: 11px 10px; border-bottom: 1px dashed var(--trait); vertical-align: top; }
.liste tr:hover td { background: var(--principal-voile); }
.liste tr[data-lien] { cursor: pointer; }
.liste tr[data-lien]:hover a { text-decoration: underline; }
.liste td a { text-decoration: none; }
.liste td.quand { font-family: var(--machine); font-size: .9rem; white-space: nowrap; }
.pagination { display: flex; gap: 14px; justify-content: center; margin-top: 22px; align-items: center;
              font-family: var(--machine); }

/* --- Formulaire de fiche --- */
fieldset.verrou { border: none; margin: 0; padding: 0; min-width: 0; }
fieldset.verrou:disabled input, fieldset.verrou:disabled select, fieldset.verrou:disabled textarea {
  border-color: var(--trait); background: none; color: var(--encre-douce); cursor: not-allowed; }
fieldset.verrou:disabled .ajout-fichiers { display: none; }
.fiche { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 36px; align-items: start; }
.cote { position: sticky; top: 24px; display: grid; gap: 34px; padding-top: 14px; }
.cote .carte { margin: 0; padding: 26px 20px 18px; }
.cote .carte > h2 { font-size: 1.2rem; }
form#fiche .carte:first-of-type { margin-top: 14px; }

.champ { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 22px; padding: 12px 0; }
.champ > label, .champ > .label { padding-top: 7px; }
.champ .aide { font-family: var(--em-font); font-size: .85rem; color: var(--encre-douce); margin: 6px 0 0;
               line-height: 1.4; }
.champ .aide strong { color: var(--encre); font-weight: normal; text-decoration: underline wavy var(--principal); }
.compteur + .aide { margin-top: 0; }
.intro { max-width: 760px; margin: 10px 0 0; line-height: 1.5; }
.champ.modifie > label, .champ.modifie > .label { color: var(--sapin); }
.champ.modifie > label::before, .champ.modifie > .label::before { content: "✎ "; }

/* Saisie : machine à écrire sur ligne pointillée, comme le formulaire d'adhésion */
input[type=text], input[type=email], input[type=url], input[type=number], input[type=search],
input[type=datetime-local], select, textarea {
  width: 100%; font-family: var(--machine); font-size: .95rem; color: var(--encre);
  background: var(--papier); border: none; border-bottom: 2px dashed var(--principal);
  border-radius: 0; padding: 7px 8px; outline: none; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; border: 2px dashed var(--principal); }
textarea.long { min-height: 180px; }
select { cursor: pointer; }
/* Sans ça, certains navigateurs ouvrent la liste en blanc sur blanc en thème sombre */
option, optgroup { background: var(--papier); color: var(--encre); }
input:focus, select:focus, textarea:focus { border-color: var(--principal-texte); border-style: solid;
  background: var(--principal-voile); }
input::placeholder, textarea::placeholder { color: var(--encre-douce); opacity: .7; }
.compteur { font-family: var(--machine); font-size: .8rem; color: var(--encre-douce); text-align: right;
            margin-top: 3px; }
.compteur.trop { color: var(--principal-texte); font-weight: bold; }
.champ.depasse textarea, .champ.depasse input { border-color: var(--principal-texte); border-style: solid; }

.choix { display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 6px; }
.choix label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
input[type=checkbox] { accent-color: var(--principal); width: 17px; height: 17px; margin: 0; }
.choix label:has(input:checked) { color: var(--principal-texte); }

.visuels { display: flex; flex-wrap: wrap; gap: 16px; }
.visuel { width: 168px; font-family: var(--machine); font-size: .75rem; color: var(--encre-douce); }
.visuel img { width: 168px; height: 108px; object-fit: cover; display: block; margin-bottom: 6px;
              border: 2px solid var(--principal); }
.visuel label { display: flex; gap: 6px; align-items: center; cursor: pointer; font-family: var(--titre-font);
                font-size: .9rem; color: var(--encre); }
.visuel:has(input:not(:checked)) img { opacity: .25; filter: grayscale(1); }
.visuel:has(input:not(:checked)) span { text-decoration: line-through; }
.ajout-fichiers { margin-top: 14px; font-family: var(--machine); font-size: .85rem; }
input[type=file]::file-selector-button { font-family: var(--titre-font); font-size: .95rem;
  color: var(--principal-texte); background: none; border: 2px solid var(--principal); border-radius: 0;
  padding: 5px 14px; margin-right: 12px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--principal); color: var(--sur-principal); }

/* --- Boutons : rectangles, ombre franche --- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--titre-font); font-size: 1rem;
       padding: 8px 18px; border: 2px solid var(--principal); border-radius: 0; background: var(--fond);
       color: var(--principal-texte); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--principal); color: var(--sur-principal); }
/* Ombre décalée en rose fluo : comme un calage riso un peu raté */
.btn.plein { background: var(--bouton); border-color: var(--bouton); color: var(--sur-bouton);
             box-shadow: 3px 3px 0 var(--rose); }
.btn.plein:hover { background: var(--principal); border-color: var(--principal); color: var(--sur-principal); }
.btn.plein:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.petit { padding: 3px 10px; font-size: .9rem; }
.btn.discret { border-color: transparent; background: none; color: var(--encre-douce);
               text-decoration: underline; text-underline-offset: 3px; }
.btn.discret:hover { color: var(--principal-texte); background: none; }
.btn:disabled { opacity: .55; cursor: default; }

.barre { position: sticky; bottom: 0; margin: 0 0 40px; padding: 12px 0; background: var(--fond);
         border-top: 2px solid var(--principal); display: flex; align-items: center;
         justify-content: space-between; gap: 16px; z-index: 5; }
.barre .etat { color: var(--encre-douce); font-family: var(--em-font); }
.barre .etat.modifie { color: var(--sapin); }
.barre .etat.attente { color: var(--principal-texte); }

/* Envoi en cours */
.roue { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor;
        border-right-color: transparent; animation: tourne .7s linear infinite; }
.btn.en-cours { opacity: 1; cursor: progress; }
.btn.en-cours .roue { display: inline-block; }
.retirer.en-cours { opacity: .4; }
body.occupe { cursor: progress; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* --- Liens d'une séance (films, référent·es) --- */
.liens { list-style: none; margin: 0 0 14px; padding: 0; }
.liens li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
            padding: 7px 0; border-bottom: 1px dashed var(--trait); }
.liens li::before { content: "→"; color: var(--principal); }
.liens li.vide::before { content: none; }
.liens.films li::before { color: var(--rose); }
.liens.films li a { color: var(--rose-texte); }
.liens li > span { flex: 1; }
.liens li a { text-decoration: none; }
.liens li small { display: block; color: var(--encre-douce); font-family: var(--em-font); font-size: .82rem; }
.liens form { margin: 0; }
.retirer { font: inherit; font-family: var(--machine); background: none; border: none;
           color: var(--encre-douce); cursor: pointer; padding: 0 4px; }
.retirer:hover { color: var(--principal-texte); }
.retirer:disabled { visibility: hidden; }
.recherche { position: relative; }
.resultats { position: absolute; left: 0; right: 0; top: calc(100% + 2px); background: var(--papier);
             border: 2px solid var(--principal); z-index: 10; max-height: 280px; overflow: auto; }
.resultats button { display: block; width: 100%; text-align: left; font: inherit; color: var(--encre);
                    background: none; border: none; padding: 8px 10px; cursor: pointer;
                    border-top: 1px dashed var(--trait); }
.resultats button:first-child { border-top: none; }
.resultats button:hover, .resultats button:focus { background: var(--principal); color: var(--sur-principal);
                                                   outline: none; }
.resultats small { display: block; font-family: var(--em-font); opacity: .8; }
.resultats button.avec-image { display: flex; gap: 10px; align-items: center; }
.resultats button.avec-image img { width: 34px; height: 51px; object-fit: cover; flex: none;
                                   background: var(--principal-voile); }

/* --- Remplissage automatique (TMDB) : le chat guide, cadre plein pour se distinguer --- */
/* Bulle d'aide du chat (gabarit _bulle.html) : pour les explications, pas pour les erreurs */
.aide-chat { position: relative; display: flex; align-items: flex-end; gap: 14px; margin: 6px 0 30px; }
/* « meow » qui s'envole du chat quand on clique dessus (sans bulle, ne décale rien) */
.meow { position: absolute; left: 6px; bottom: 52px; pointer-events: none; font-family: var(--chat-font);
        font-size: .95rem; color: var(--rose-texte); animation: meow 1.3s ease-out forwards; }
.meow.fort { font-size: 1.5rem; color: var(--principal-texte); animation-duration: 1.5s; }
@keyframes meow { from { opacity: 1; transform: translate(0, 0); }
                  to { opacity: 0; transform: translate(var(--derive, 0), -46px); } }
.chat-guide { width: 48px; height: 57px; flex: none; }
/* Le contour (2 px) et l'ombre rose viennent de filtres : ils suivent aussi la pointe en escalier */
.bulle { --fond-bulle: var(--papier);
         position: relative; margin: 0 0 16px; padding: 10px 14px; max-width: 680px; line-height: 1.4;
         font-family: var(--chat-font); font-size: 1.06rem;
         font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; /* « fi » mal dessiné */
         background: var(--fond-bulle);
         filter: drop-shadow(2px 0 0 var(--encre)) drop-shadow(-2px 0 0 var(--encre))
                 drop-shadow(0 2px 0 var(--encre)) drop-shadow(0 -2px 0 var(--encre))
                 drop-shadow(3px 3px 0 var(--rose)); }
/* Pointe en escalier, en pixels, qui descend vers le chat */
.bulle::before { content: ""; position: absolute; left: -15px; bottom: 6px; width: 16px; height: 14px;
                 background: var(--fond-bulle);
                 clip-path: polygon(16px 0, 12px 0, 12px 4px, 8px 4px, 8px 8px, 4px 8px, 4px 12px,
                                    0 12px, 0 14px, 16px 14px); }
.bulle strong { color: var(--principal-texte); font-weight: normal; }
.bulle p { margin: 0; }
.bulle p + p { margin-top: 6px; }
.bulle .bonjour { font-size: 1.35rem; color: var(--principal-texte); }

/* Petit secret : 5 clics sur le chat, il s'agace et tremble ; 3 de plus, il crie.
   Le cri se pose par-dessus la bulle, dont le texte est seulement masqué : la page ne bouge pas. */
.aide-chat.agace .chat-guide { animation: tremble-fort .06s linear infinite; }
.aide-chat.colere .bulle { --fond-bulle: var(--principal); animation: tremble .12s linear infinite; }
.aide-chat.colere .bulle > :not(.cri) { visibility: hidden; }
.bulle .cri { position: absolute; left: 0; bottom: 0; min-width: 100%; min-height: 100%; margin: 0;
              display: flex; align-items: center; justify-content: center; padding: 10px 20px;
              background: var(--principal); color: #000; font-size: 1.7rem; line-height: 1.05;
              letter-spacing: .03em; white-space: nowrap; }
@keyframes tremble { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-2px, 1px) rotate(-1deg); }
                     50% { transform: translate(2px, -1px) rotate(1deg); } 75% { transform: translate(-1px, -2px) rotate(-1deg); }
                     100% { transform: translate(1px, 2px) rotate(1deg); } }
@keyframes tremble-fort { 0% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(-4px, 2px) rotate(-9deg); }
                          40% { transform: translate(4px, -2px) rotate(8deg); } 60% { transform: translate(-3px, -3px) rotate(-7deg); }
                          80% { transform: translate(3px, 3px) rotate(9deg); } 100% { transform: translate(0, 0) rotate(0); } }
@media (prefers-reduced-motion: reduce) { .aide-chat.agace .chat-guide, .aide-chat.colere .bulle { animation: none; } }
.carte.tmdb { border: 2px solid var(--principal); }
.tmdb-barre { display: flex; gap: 10px; align-items: center; max-width: 620px; margin-top: 6px; }
.tmdb-barre input { flex: 1; font-size: 1.05rem; padding: 10px 10px; }
.tmdb-barre .resultats { top: calc(100% + 4px); }
.tmdb-pied { margin: 12px 0 0; font-family: var(--em-font); font-size: .85rem; color: var(--encre-douce); }
.tmdb-choix { margin-top: 18px; }
.tmdb-choix .msg { margin-bottom: 14px; }
.tmdb-choix .label { margin: 4px 0 10px; }
.tmdb-visuel { cursor: pointer; }
.tmdb-visuel span { display: flex; gap: 6px; align-items: center; font-family: var(--titre-font);
                    font-size: .9rem; color: var(--encre); margin-top: 4px; }
.tmdb-visuel:has(input:not(:checked)) img { opacity: .6; filter: none; }
.tmdb-visuel:has(input:not(:checked)) span { text-decoration: none; }
.tmdb-visuel:has(input:checked) img { outline: 3px solid var(--rose); outline-offset: 2px; }
.champ.prerempli > label::after, .champ.prerempli > .label::after { content: " ↺"; color: var(--rose-texte); }
.resultats .rien { padding: 8px 10px; color: var(--encre-douce); font-family: var(--em-font); }

/* --- Historique --- */
.histo { width: 100%; border-collapse: collapse; font-size: .92rem; }
.histo th { text-align: left; font-weight: normal; font-family: var(--em-font); color: var(--encre-douce);
            padding: 6px 8px; border-bottom: 2px solid var(--principal); }
.histo td { padding: 9px 8px; border-bottom: 1px dashed var(--trait); vertical-align: top; }
.histo .val { font-family: var(--machine); font-size: .85rem; white-space: pre-wrap; word-break: break-word;
              max-width: 420px; display: inline-block; }
.histo .avant { color: var(--encre-douce); text-decoration: line-through; }
/* Le nouveau texte est surligné, comme au marqueur */
.histo .apres { color: var(--encre); background: linear-gradient(transparent 55%, var(--soleil) 55%); }
.histo .quand { white-space: nowrap; font-family: var(--machine); font-size: .82rem; color: var(--encre-douce); }

/* --- Connexion --- */
.connexion { max-width: 520px; margin: 6vh auto 0; }
.connexion .carte { padding: 40px 36px 30px; }
.connexion h1 { font-size: 2.3rem; color: var(--principal); margin: 0 0 12px; }
.connexion form { display: grid; gap: 18px; margin-top: 26px; }
.connexion .btn { justify-content: center; }
.bilan { text-align: center; margin: 26px auto 0; max-width: 520px; font-family: var(--chat-font);
         font-variant-ligatures: none; color: var(--encre-douce); }
.bilan strong { font-weight: normal; font-size: 1.6rem; color: var(--rose-texte); padding: 0 2px; }

/* --- Pied de page --- */
.pied { border-top: 2px dashed var(--principal); color: var(--encre-douce); font-family: var(--em-font);
        font-size: .88rem; }
.pied .in { max-width: 1320px; margin: 0 auto; padding: 18px 32px 26px; display: flex; flex-wrap: wrap;
            gap: 6px 28px; align-items: baseline; }
.pied strong { color: var(--principal); font-family: var(--titre-font); font-weight: normal; font-size: 1rem; }

@media (max-width: 1100px) {
  .fiche { grid-template-columns: minmax(0, 1fr) 290px; }
}
@media (max-width: 820px) {
  .bandeau .in { flex-wrap: wrap; gap: 10px 20px; padding: 14px 16px 10px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  main { padding: 24px 16px 80px; }
  .entete { flex-direction: column; align-items: flex-start; }
  .entete h1 { font-size: 2rem; }
  .fiche { grid-template-columns: minmax(0, 1fr); }
  .histo, table.liste { display: block; overflow-x: auto; }
  .cote { position: static; }
  .carte { padding: 26px 16px 18px; }
  .champ { grid-template-columns: 1fr; }
  .champ > label, .champ > .label { padding-top: 0; }
  .seance-ligne { grid-template-columns: 1fr; gap: 4px; }
  .seance-ligne .btn { display: none; }
  .liste .masquer { display: none; }
}
