/* Cineco — Bibliothèque en étagères. */
.bib-hint { font-size: 12.5px; color: var(--ink-2); text-align: center; transition: opacity .4s ease; }
.bib-hint.gone { opacity: 0; }
.bib-hint.nudge { animation: bib-nudge .5s var(--spring); color: var(--ink); }
@keyframes bib-nudge { 30% { transform: scale(1.05); } }

/* Le meuble */
.bib-case { position: relative; padding: 14px 10px 6px; border-radius: 26px;
  background: linear-gradient(180deg, #1c1917 0%, #141211 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 18px 40px rgba(0, 0, 0, .5), 0 18px 40px rgba(0, 0, 0, .35);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.shelf { position: relative; animation: cardin .5s var(--ease) backwards; }
.shelf + .shelf { margin-top: 12px; }
.books { display: flex; align-items: flex-end; gap: 3px; min-height: 208px; padding: 6px 2px 0; }
/* fond de l'étagère : léger renfoncement */
.shelf::before { content: ""; position: absolute; inset: 0 0 12px; border-radius: 10px; background: linear-gradient(180deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .12)); pointer-events: none; }
/* la planche */
.plank { position: relative; height: 12px; margin-inline: -4px; border-radius: 3px;
  background: linear-gradient(180deg, #4a3d33 0%, #33291f 45%, #1f1813 100%);
  box-shadow: 0 10px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .16); }
.bib-n { text-align: center; padding: 12px 0 6px; }

/* Un livre vu de dos : mini-affiche en haut, titre le long de la tranche, note en bas */
.book { --tint: 110, 118, 130; position: relative; z-index: 1; flex: none; width: var(--w); height: var(--h); padding: 0; border: 0; border-radius: 3px 3px 1px 1px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; color: #F1F2F4; cursor: pointer; touch-action: pan-y;
  background: linear-gradient(90deg, rgba(0, 0, 0, .42) 0%, rgba(255, 255, 255, .10) 14%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .30) 100%), rgb(var(--tint));
  background-blend-mode: normal; filter: saturate(.72) brightness(.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 2px 0 4px rgba(0, 0, 0, .35);
  transform-origin: 50% 100%; transition: transform .34s var(--spring), filter .25s ease, box-shadow .25s ease, opacity .2s ease; }
.book::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--w) * 1.5 + 5px); height: 1px; background: rgba(255, 255, 255, .22); box-shadow: 0 3px 0 rgba(255, 255, 255, .10); }
.bk-img { flex: none; width: 100%; aspect-ratio: 2 / 3; background: rgba(0, 0, 0, .35); overflow: hidden; }
.bk-img img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.bk-t { flex: 1 1 auto; min-height: 0; margin-top: 9px; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.bk-r { flex: none; min-height: 15px; padding-bottom: 3px; font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums; opacity: .85; }

/* Livre choisi : cadre blanc, il avance et grossit un peu ; ses voisins s'écartent */
.book.sel { z-index: 3; filter: none; transform: translateY(-9px) scale(1.16); box-shadow: 0 0 0 2px #fff, 0 16px 28px rgba(0, 0, 0, .6); border-radius: 4px; }
.book.push-l { transform: translateX(-5px) rotate(-2.200deg); }
.book.push-r { transform: translateX(5px) rotate(2.200deg); }
.book.hit.push-l { animation: bk-hit-l .42s var(--spring); }
.book.hit.push-r { animation: bk-hit-r .42s var(--spring); }
@keyframes bk-hit-l { 0% { transform: translateX(3px) rotate(1deg); } 35% { transform: translateX(-11px) rotate(-5deg); } 100% { transform: translateX(-5px) rotate(-2.200deg); } }
@keyframes bk-hit-r { 0% { transform: translateX(-3px) rotate(-1deg); } 35% { transform: translateX(11px) rotate(5deg); } 100% { transform: translateX(5px) rotate(2.200deg); } }
.book.gone { opacity: 0; }
body.bib-holding { overflow: hidden; }
body.bib-holding .book:not(.sel) { filter: saturate(.5) brightness(.56); }

/* Le livre qui sort et s'ouvre */
.fly { --tint: 120, 130, 145; position: fixed; inset: 0; z-index: 90; perspective: 1400px; overflow: hidden; }
.fly-bk { position: absolute; transform-style: preserve-3d; transform-origin: 0 0; will-change: transform; }
.fly-pages { position: absolute; inset: 2% 1% 2% 0; border-radius: 3px 10px 10px 3px; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 12%; text-align: center; color: #1b1c20;
  background: linear-gradient(90deg, #cfcabf 0%, #f3efe6 9%, #ebe6dc 100%); box-shadow: inset 8px 0 14px rgba(0, 0, 0, .18), 0 20px 50px rgba(0, 0, 0, .6); }
.fly-pages b { font-size: 17px; line-height: 1.2; }
.fly-pages span { font-size: 12px; opacity: .7; }
.fly-cover { position: absolute; inset: 0; transform-style: preserve-3d; transform-origin: 0 50%; will-change: transform; }
.fly-front, .fly-back { position: absolute; inset: 0; border-radius: 4px 12px 12px 4px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fly-front { background: rgb(var(--tint)); display: grid; place-items: center; color: #fff; padding: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .6), 0 0 60px rgba(var(--tint), .35); }
.fly-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fly-front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .45) 0%, rgba(255, 255, 255, .16) 4%, rgba(0, 0, 0, 0) 12%); }
.fly-back { transform: rotateY(180deg); background: linear-gradient(90deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 30%), rgb(var(--tint)); filter: brightness(.6); }

/* Mes listes, sous les étagères */
#bib-lists { display: grid; gap: 12px; }
#bib-lists .chip { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
#bib-lists .bar-in { position: static; margin-top: 0; }

/* ═════════ Mes listes : cartes en petite étagère ═════════ */
.lgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lcard { position: relative; display: grid; gap: 2px; padding: 14px 14px 13px; border: 0; border-radius: 24px; text-align: left; color: inherit; text-decoration: none; overflow: hidden;
  background: linear-gradient(180deg, #1f1b18 0%, #151312 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 12px 26px rgba(0, 0, 0, .32);
  animation: cardin .45s var(--ease) backwards; transition: transform .3s var(--spring), box-shadow .3s ease; }
.lcard:active { transform: scale(.97); }
.lcard b { margin-top: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard small { font-size: 12px; color: var(--ink-2); }
.lc-shelf { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 84px; padding-top: 4px; }
.lc-shelf i { flex: none; width: 19%; aspect-ratio: 2 / 3; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, .06); box-shadow: 2px 0 4px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transform-origin: 50% 100%; transform: rotate(calc((var(--k) - 2) * 1.6deg)) translateY(calc((2 - var(--k)) * (2 - var(--k)) * -1px)); transition: transform .4s var(--spring); }
.lc-shelf i.none { opacity: .45; }
.lc-shelf img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85) brightness(.9); }
.lcard:active .lc-shelf i { transform: rotate(calc((var(--k) - 2) * 4deg)) translateY(-4px); }
.lc-plank { height: 8px; margin-inline: -4px; border-radius: 2px; background: linear-gradient(180deg, #4a3d33, #2a2119 55%, #1c1611); box-shadow: 0 8px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16); }
.lcard.new { justify-items: center; text-align: center; align-content: center; min-height: 168px; background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); border: 0; }
.lcard.new b { margin-top: 12px; }
.lc-plus { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--accent-ink); }
.lc-plus svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ═════════ Une liste ═════════ */
.list-head { display: grid; gap: 4px; padding: 18px 18px 16px; border-radius: 26px; background: linear-gradient(135deg, rgba(74, 61, 51, .55), rgba(28, 25, 23, .65)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10); }
.list-head h2 { font-size: 24px; overflow-wrap: anywhere; }
.list-tag { justify-self: start; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.list-tools { display: flex; align-items: center; gap: 8px; }
.list-tools .pillbtn { flex: 1 1 0; }
.list-tools .ibtn.arm { background: var(--bad-bg); color: var(--bad); }
.bib .m-head .seg { flex: 1; }
.bib-case.removing .book { animation: bk-wiggle .5s ease-in-out infinite alternate; cursor: pointer; }
.bib-case.removing .book:nth-child(even) { animation-delay: -.25s; }
.bib-case.removing .book::after { content: "×"; position: absolute; top: 2px; right: 2px; width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; line-height: 1; background: rgba(14, 15, 18, .85); color: #fff; }
@keyframes bk-wiggle { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }

/* Porte de sortie pendant le choix d'un livre (cineco-biblio.js, croix) */
#bib-annuler { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: grid; justify-items: center; gap: 6px; transform: translate(-50%, 16px); opacity: 0; transition: opacity .2s ease, transform .25s var(--spring, ease); pointer-events: none; }
#bib-annuler.on { opacity: 1; transform: translate(-50%, 0); }
#bib-annuler span { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(20, 21, 26, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 10px 26px rgba(0, 0, 0, .45); transition: transform .2s var(--spring, ease), background .2s; }
#bib-annuler svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
#bib-annuler small { font-size: 11.5px; color: rgba(255, 255, 255, .7); }
#bib-annuler.vise span { transform: scale(1.18); background: rgba(229, 72, 77, .85); }
