/* Geekothèque — charte Générations Geeks (anthracite, rouge GG, Roboto Condensed) */
@font-face { font-family: "Roboto"; src: url(fonts/roboto-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Roboto"; src: url(fonts/roboto-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url(fonts/roboto-condensed-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Roboto Condensed"; src: url(fonts/roboto-condensed-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Caveat"; src: url(fonts/caveat-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --fond: #1A1D24;
  --fond-2: #22262f;
  --carte: #272b35;
  --ligne: #3a3f4b;
  --texte: #ffffff;
  --texte-2: #b9bcc4;
  --texte-3: #858a96;
  --accent: #DD1D2D;
  --accent-fonce: #A71D1F;
  --sur-accent: #ffffff;
  --vert: #5bd38a;
  --vert-fond: #1d3a2a;
  --rouge: #ff5866;
  --rouge-fond: #3d1a1f;
  --envie: #f2b33d;
  --envie-fond: #3b2f17;
  --rayon: 6px;
  --police: "Roboto", Arial, sans-serif;
  --police-titre: "Roboto Condensed", "Arial Narrow", sans-serif;
  --bas: env(safe-area-inset-bottom, 0px);
  --haut: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.4 var(--police);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
code { background: var(--fond-2); padding: 1px 5px; border-radius: 5px; font-size: .9em; }

/* ---------- accès ---------- */
.acces { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.acces-carte { width: 100%; max-width: 380px; }
.logo-bloc { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo-bloc img { border-radius: 16px; }
.logo-bloc h1 { font-size: 26px; }
.intro { color: var(--texte-2); margin: 0 0 18px; }
label { display: block; font-size: 14px; color: var(--texte-2); margin-bottom: 14px; }
label input, .rangee input, textarea, select {
  display: block; width: 100%; margin-top: 6px;
  background: var(--fond-2); border: 1px solid var(--ligne); border-radius: 10px;
  padding: 12px 14px; font-size: 16px; color: var(--texte); outline: none;
}
label input:focus, textarea:focus, select:focus, .rangee input:focus { border-color: var(--accent); }
.facultatif { color: var(--texte-3); font-size: 13px; }
.erreur { color: var(--rouge); min-height: 1.2em; margin: 4px 0 12px; font-size: 14px; }
.erreur:empty { min-height: 0; margin: 0; }

/* ---------- boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600;
  background: var(--fond-2); color: var(--texte); text-decoration: none; font-size: 15px;
}
.bouton.principal { background: var(--accent); color: #1a1205; width: 100%; }
.bouton.principal:active { background: var(--accent-fonce); }
.bouton.secondaire { background: var(--carte); border: 1px solid var(--ligne); }
.bouton.lien-danger { background: none; color: var(--rouge); font-weight: 500; }
.bouton:disabled { opacity: .55; cursor: default; }
.icone-bouton { background: none; border: 0; color: var(--texte-2); padding: 8px; border-radius: 10px; display: grid; place-items: center; }
.icone-bouton.actif { color: var(--accent); }

/* ---------- structure ---------- */
.entete {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(14px + var(--haut)) 16px 10px;
  background: linear-gradient(var(--fond) 75%, transparent);
}
.entete h1 { font-size: 24px; flex: 1; }
@media (min-width: 752px) { .entete { padding-left: calc(50% - 344px); padding-right: calc(50% - 344px); } }
.pastille-hl { font-size: 12px; font-weight: 600; color: #1a1205; background: var(--accent); padding: 3px 9px; border-radius: 99px; }
main { max-width: 720px; margin: 0 auto; padding: 0 16px calc(96px + var(--bas)); }

.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: center;
  background: rgba(20, 17, 26, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--ligne);
  padding: 6px 8px calc(6px + var(--bas));
}
.onglets button {
  flex: 1; max-width: 160px; background: none; border: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--texte-3); font-size: 12px; font-weight: 600; padding: 6px 0;
}
.onglets button.actif { color: var(--accent); }

/* ---------- recherche ---------- */
.champ-recherche {
  display: flex; align-items: center; gap: 10px;
  background: var(--fond-2); border: 1px solid var(--ligne); border-radius: 14px;
  padding: 0 14px; color: var(--texte-3);
}
.champ-recherche:focus-within { border-color: var(--accent); color: var(--accent); }
.champ-recherche input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  padding: 15px 0; font-size: 18px; color: var(--texte);
}

.verdict {
  margin: 14px 0 4px; padding: 14px 16px; border-radius: var(--rayon);
  font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.verdict.oui { background: var(--vert-fond); color: var(--vert); }
.verdict.envie { background: var(--envie-fond); color: var(--envie); }
.verdict.non { background: var(--rouge-fond); color: var(--rouge); flex-direction: column; align-items: stretch; }
.verdict .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.verdict .actions .bouton { flex: 1; min-width: 140px; font-size: 14px; padding: 10px 12px; }

.accueil-recherche { text-align: center; padding: 48px 0 0; }
.compteur { font-size: 18px; margin: 0; color: var(--texte-2); }
.compteur strong { display: block; font-size: 56px; line-height: 1.05; color: var(--accent); font-weight: 800; letter-spacing: -0.03em; }
.compteur-secondaire { color: var(--texte-3); margin: 6px 0 0; }

/* ---------- listes ---------- */
.liste { list-style: none; margin: 10px 0 0; padding: 0; }
.film {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 8px; margin: 0 -8px; border-radius: 12px;
  background: none; border: 0; text-align: left;
}
.film:active, .film:hover { background: var(--fond-2); }
.vignette {
  flex: none; width: 46px; height: 69px; border-radius: 6px; object-fit: cover;
  background: var(--carte) center/60% no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%237f7690' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='12' r='2.5' fill='%237f7690'/%3E%3C/svg%3E");
}
.film-texte { flex: 1; min-width: 0; }
.film-titre { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; }
.film-sous { color: var(--texte-3); font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.film mark { background: none; color: var(--accent); }
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px;
  margin: 0; white-space: nowrap;
}
.badge.collection { background: var(--vert-fond); color: var(--vert); }
.badge.envie { background: var(--envie-fond); color: var(--envie); }
.film .badge { flex: none; }
.film .bouton { flex: none; padding: 8px 12px; font-size: 13px; }
.ligne-film { display: flex; align-items: center; gap: 8px; }
.ligne-film .film { flex: 1; min-width: 0; margin-right: 0; }

.groupe { position: sticky; top: calc(56px + var(--haut)); z-index: 2; background: var(--fond);
  color: var(--accent); font-weight: 800; font-size: 15px; padding: 10px 0 4px; margin-top: 6px;
  border-bottom: 1px solid var(--ligne); }

.barre-outils { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.barre-outils select { width: auto; margin: 0; padding: 9px 12px; flex: 1; min-width: 150px; }
.resume { color: var(--texte-3); font-size: 14px; margin: 12px 0 0; }
.vide { text-align: center; color: var(--texte-2); padding: 40px 0; }

.segment { display: inline-flex; background: var(--fond-2); border: 1px solid var(--ligne); border-radius: 11px; padding: 3px; }
.segment button { background: none; border: 0; padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--texte-2); font-size: 14px; }
.segment button.actif { background: var(--accent); color: #1a1205; }
.segment.petit { margin: 0 0 14px; display: flex; }
.segment.petit button { flex: 1; }

.flottant {
  position: fixed; right: max(16px, calc(50% - 344px)); bottom: calc(84px + var(--bas)); z-index: 4;
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--accent); color: #1a1205; font-size: 30px; font-weight: 400;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); display: grid; place-items: center;
}

/* ---------- réglages ---------- */
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 16px; margin-bottom: 14px; }
.carte h2 { font-size: 17px; margin-bottom: 8px; }
.aide { color: var(--texte-3); font-size: 14px; margin: 0 0 12px; }
.rangee { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.rangee input { margin: 0; flex: 1; min-width: 160px; }
.rangee .bouton.principal { width: auto; flex: 1; }
textarea { resize: vertical; margin: 0 0 12px; font-family: inherit; }
.fichier { cursor: pointer; margin: 0; font-size: 14px; color: var(--texte); }
.jauge { height: 8px; background: var(--fond-2); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.jauge div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.bilan-titre { font-weight: 700; margin: 16px 0 6px; font-size: 15px; }
li.choix { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.choix { border-top: 1px solid var(--ligne); padding: 10px 0; }
.choix-ligne { font-weight: 600; margin: 0 0 6px; }
.choix-cands { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.cand { flex: none; width: 96px; background: var(--fond-2); border: 1px solid var(--ligne); border-radius: 10px; padding: 6px; text-align: left; font-size: 12px; }
.cand img, .cand .vignette { width: 100%; height: 126px; border-radius: 6px; object-fit: cover; display: block; margin-bottom: 4px; }
.cand.ignorer { display: grid; place-items: center; color: var(--texte-3); font-weight: 600; }
.cand.fait { opacity: .35; pointer-events: none; }

/* ---------- feuilles (fiche, ajout) ---------- */
.feuille { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.feuille-fond { position: absolute; inset: 0; background: rgba(5, 3, 8, .7); animation: fondu .18s; }
.feuille-contenu {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--fond-2); border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + var(--bas));
  animation: monte .22s cubic-bezier(.2,.8,.3,1);
}
.feuille-contenu.haute { min-height: 80vh; }
.feuille-contenu h2 { font-size: 21px; margin: 0 0 14px; padding-right: 40px; }
@media (min-width: 700px) {
  .feuille { align-items: center; }
  .feuille-contenu { border-radius: 22px; }
  .feuille-contenu.haute { min-height: 70vh; }
}
.fermer { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--carte); color: var(--texte-2); font-size: 15px; }
@keyframes monte { from { transform: translateY(40px); opacity: 0; } }
@keyframes fondu { from { opacity: 0; } }

.fiche-haut { display: flex; gap: 16px; }
.fiche-jaquette { flex: none; width: 128px; }
.fiche-jaquette img { width: 128px; height: 192px; border-radius: 10px; object-fit: cover; background: var(--carte); display: block; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.fiche-infos { min-width: 0; padding-top: 4px; }
.fiche-infos h2 { padding-right: 34px; margin: 8px 0 4px; font-size: 22px; line-height: 1.2; }
.original { color: var(--texte-3); font-style: italic; margin: 0 0 6px; font-size: 14px; }
.meta { color: var(--texte-2); margin: 0; font-weight: 600; }
.fiche-details { margin: 20px 0 0; }
.fiche-details dt { color: var(--texte-3); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.fiche-details dd { margin: 4px 0 14px; color: var(--texte); }
.fiche-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

.toast {
  position: fixed; left: 50%; bottom: calc(92px + var(--bas)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--texte); color: var(--fond); font-weight: 600; font-size: 15px;
  padding: 10px 16px; border-radius: 12px; width: max-content; max-width: min(340px, calc(100% - 32px)); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- accueil : tuiles des collections ---------- */
.tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 6px; }
.tuile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 18px;
  padding: 18px 16px; min-height: 140px; color: var(--texte);
}
.tuile:active { background: var(--fond-2); }
.tuile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 110px; }
.tuile-icone { font-size: 30px; line-height: 1; }
.tuile-nom { font-weight: 800; font-size: 18px; margin-top: auto; }
.tuile-nb { color: var(--accent); font-weight: 800; font-size: 26px; line-height: 1; }
.tuile-envies { color: var(--texte-3); font-size: 13px; }
@media (min-width: 640px) { .tuiles { grid-template-columns: repeat(3, 1fr); } .tuile:last-child:nth-child(odd) { grid-column: auto; } }

/* ---------- recherche + scan ---------- */
.rangee-recherche { display: flex; gap: 8px; align-items: stretch; }
.rangee-recherche .champ-recherche { flex: 1; min-width: 0; }
.bouton-scan { flex: none; width: 56px; border-radius: 14px; border: 1px solid var(--ligne); background: var(--fond-2); color: var(--accent); display: grid; place-items: center; }
#ajout .rangee-recherche { margin-bottom: 4px; }
.manuel { margin-top: 14px; }
.manuel button { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

/* ---------- envies ---------- */
.film-raison { display: block; color: var(--envie); font-size: 13px; margin-top: 2px; }
.actions-envie { display: flex; gap: 6px; flex: none; }
.mini { border: 1px solid var(--ligne); background: var(--carte); color: var(--texte); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600; }
.mini.non { color: var(--texte-3); padding: 8px 11px; }

/* ---------- fiche ---------- */
.raison { color: var(--envie); font-weight: 600; margin: 14px 0 0; }
.raison:empty { display: none; }
.fiche-resume { color: var(--texte-2); line-height: 1.55; margin: 0 0 8px; white-space: pre-line; }
.fiche-resume:empty { display: none; }
.cle-actuelle { float: right; color: var(--texte-3); font-size: 13px; }
#form-edition textarea { margin-top: 6px; }
.feuille-contenu label select { margin-top: 6px; }


/* ================================================================ charte GG */
body { background: url(icones/motif-geek.svg) no-repeat right -24px bottom 70px / 230px auto fixed, var(--fond); }
.logo-bloc h1, .entete h1 { font-family: var(--police-titre); font-weight: 800; letter-spacing: 0; }
.entete { background: linear-gradient(var(--fond) 80%, transparent); border-bottom: 1px solid var(--ligne); padding-bottom: 12px; margin-bottom: 10px; }
.entete h1 { font-size: 26px; }
body[data-media] .entete h1 { flex: none; margin-right: auto; padding-bottom: 2px; box-shadow: inset 0 -3px 0 var(--accent); }
h2 { font-family: var(--police-titre); font-weight: 700; }

/* accueil */
.tuiles { grid-template-columns: 1fr 1fr; gap: 10px; }
.tuile, .tuile:last-child:nth-child(odd) { grid-column: auto; min-height: 120px; border-radius: var(--rayon); padding: 14px; position: relative; }
.tuile-icone { position: absolute; right: 14px; top: 14px; color: var(--texte-3); line-height: 0; }
.tuile-icone svg { width: 26px; height: 26px; }
.tuile-nb { order: 2; margin-top: auto; font-family: var(--police-titre); font-weight: 800; font-size: 44px; line-height: .95; color: var(--texte); }
.tuile-nom { order: 3; margin-top: 4px; font-family: var(--police-titre); font-weight: 700; font-size: 18px; color: var(--texte-2); }
.tuile-envies { order: 4; color: var(--envie); font-size: 12.5px; }
.tuile:hover, .tuile:focus-visible { border-color: var(--accent); }
.tuile:hover .tuile-icone { color: var(--accent); }
@media (min-width: 640px) { .tuiles { grid-template-columns: repeat(5, 1fr); } .tuile, .tuile:last-child:nth-child(odd) { min-height: 140px; } }

/* recherche */
.compteur strong { font-family: var(--police-titre); font-weight: 800; color: var(--texte); font-size: 72px; }
.compteur strong::after { content: ""; display: block; width: 44px; height: 4px; background: var(--accent); margin: 8px auto 10px; }
.champ-recherche, .bouton-scan { border-radius: var(--rayon); }
.bouton-scan { color: var(--texte-2); }
.verdict { border-radius: var(--rayon); font-family: var(--police-titre); font-weight: 800; font-size: 20px; }
.verdict.oui { background: var(--vert-fond); color: var(--vert); box-shadow: inset 4px 0 0 var(--vert); }
.verdict.envie { box-shadow: inset 4px 0 0 var(--envie); }
.verdict.non { background: var(--accent); color: var(--sur-accent); }
.verdict.non .bouton { background: rgba(0,0,0,.25); border: 0; color: var(--sur-accent); font-family: var(--police); }

/* listes */
.film { border-radius: 0; border-bottom: 1px solid var(--ligne); }
.film:hover, .film:active { background: var(--fond-2); }
.vignette { border-radius: 4px; }
.badge { border-radius: 4px; font-family: var(--police-titre); font-weight: 700; font-size: 12.5px; }
.groupe { display: inline-block; color: var(--texte); font-family: var(--police-titre); font-weight: 800; font-size: 18px; padding-right: 8px; margin-bottom: 4px; border-bottom: 2px solid var(--accent); }
.film-raison { color: var(--envie); }
.raison { color: var(--envie); }

/* contrôles */
.segment, .segment button, .bouton, .mini { border-radius: var(--rayon); }
.segment button.actif, .bouton.principal, .flottant { background: var(--accent); color: var(--sur-accent); }
.bouton.principal:active { background: var(--accent-fonce); }
label input:focus, textarea:focus, select:focus, .rangee input:focus, .champ-recherche:focus-within { border-color: var(--accent); }
.champ-recherche:focus-within { color: var(--accent); }
.flottant { border-radius: 8px; font-size: 28px; box-shadow: 0 8px 22px rgba(221,29,45,.35); }
.manuel button { color: var(--texte); text-decoration-color: var(--accent); }
.carte { border-radius: var(--rayon); }
.pastille-hl { background: var(--accent); color: var(--sur-accent); }
.jauge div { background: var(--accent); }
.icone-bouton.actif { color: var(--texte); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* barre du bas */
.onglets { background: rgba(26,29,36,.97); }
.onglets button.actif { color: var(--texte); box-shadow: inset 0 3px 0 var(--accent); }

/* fiches */
.feuille-contenu { background: var(--fond-2); border-top: 1px solid var(--ligne); }
@media (min-width: 700px) { .feuille-contenu { border: 1px solid var(--ligne); } }
.fiche-infos h2 { font-family: var(--police-titre); font-weight: 800; font-size: 26px; }
.fiche-details dt { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 700; color: var(--texte-3); }
.toast { border-radius: var(--rayon); }

/* derniers ajouts */
.recents { margin-top: 28px; }
.recents h2 { font-size: 18px; margin: 0 0 12px; display: inline-block; padding-bottom: 3px; border-bottom: 2px solid var(--accent); }
.recents-liste { display: grid; grid-auto-flow: column; grid-auto-columns: 104px; gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.recent { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; color: var(--texte); }
.recent img, .recent-vide { width: 104px; height: 156px; object-fit: cover; border-radius: 4px; background: var(--carte); border: 1px solid var(--ligne); display: grid; place-items: center; color: var(--texte-3); }
.recent-vide svg { width: 30px; height: 30px; }
.recent:hover img, .recent:hover .recent-vide, .recent:focus-visible img { border-color: var(--accent); }
.recent-titre { font-size: 13px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-media { font-size: 12px; color: var(--texte-3); margin-top: -4px; }
@media (min-width: 752px) { .recents-liste { grid-auto-flow: row; grid-template-columns: repeat(6, 1fr); grid-auto-columns: auto; overflow: visible; } .recent img, .recent-vide { width: 100%; height: auto; aspect-ratio: 2 / 3; } }

/* logo sur l'accueil */
.logo-accueil { flex: 1; margin: 0; display: flex; align-items: center; gap: 14px; }
.logo-accueil img { height: 56px; width: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
.logo-accueil span { flex: 1; text-align: center; padding-right: 20px; font-family: "Caveat", var(--police-titre); font-weight: 700; font-size: 38px; line-height: 1; }
.logo-bloc h1 span { font-family: "Caveat", var(--police-titre); font-weight: 700; font-size: 44px; line-height: 1; }
.logo-bloc h1 { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo-bloc h1 img { height: 96px; width: auto; display: block; filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
