/* V9.9.71 — somente a Biblioteca dedicada; Central, Loja e leitor intactos. */
html body #ca-center-backdrop.ca-open.ca-library-only {
 padding:0!important;overflow:hidden!important;align-items:center!important;justify-content:center!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center {
 position:relative!important;box-sizing:border-box!important;
 width:min(100vw,calc(100dvh * 1670 / 942))!important;max-width:none!important;
 height:auto!important;max-height:none!important;aspect-ratio:1670 / 942!important;
 min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
 background:#482e50 url('biblioteca-v9971.png?v=9976') center / 100% 100% no-repeat!important;
 overflow:hidden!important;display:block!important;container-type:inline-size;
}
html body #ca-center-backdrop.ca-library-only #ca-center>.ca-head {
 display:block!important;position:absolute!important;inset:0!important;height:100%!important;
 width:100%!important;padding:0!important;margin:0!important;background:none!important;border:0!important;
 pointer-events:none!important;z-index:5!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title {
 position:absolute!important;left:4.5%!important;top:24%!important;width:25%!important;
 display:flex!important;justify-content:center!important;margin:0!important;padding:0!important;
 background:none!important;border:0!important;box-shadow:none!important;font-size:0!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center-title>img {display:none!important;}
html body #ca-center-backdrop.ca-library-only .ca-library-heading {font-size:0!important;gap:0!important;width:100%!important;align-items:center!important;}
html body #ca-center-backdrop.ca-library-only #ca-library-count {
 display:block!important;font:800 clamp(9px,1.42cqw,22px)/1.3 'Trebuchet MS',sans-serif!important;
 color:#fff6cf!important;text-shadow:0 1px 3px #29132a,0 1px 5px #29132a!important;
 background:#3c2349e8!important;border:1px solid #e9b755!important;border-radius:9px!important;
 padding:.50cqw 1cqw!important;white-space:nowrap!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-head>button.ca-close {
 position:absolute!important;top:1.8%!important;right:1.6%!important;left:auto!important;bottom:auto!important;
 pointer-events:auto!important;z-index:10!important;
 background:transparent var(--ca-close-official-art,url('../ca-x-mapa-oficial-v9955.png')) center / contain no-repeat!important;
 display:block!important;opacity:1!important;visibility:visible!important;
 color:transparent!important;font-size:0!important;border:0!important;box-shadow:none!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center [data-ca-pane="guardians"]:not([hidden]) {
 position:absolute!important;inset:0!important;height:100%!important;width:100%!important;
 min-height:0!important;max-height:none!important;padding:0!important;margin:0!important;
 border:0!important;background:transparent!important;box-shadow:none!important;overflow:hidden!important;display:block!important;
}
html body #ca-center-backdrop.ca-library-only #ca-guardian-center-list {
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-height:0!important;
 display:block!important;margin:0!important;padding:0!important;overflow:hidden!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase {
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;min-width:0!important;
 max-width:none!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important;padding:0!important;
 pointer-events:none!important;z-index:1!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase-art {
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;
 object-fit:fill!important;visibility:hidden!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center button.ca-book-spine {
 pointer-events:auto!important;overflow:hidden!important;transition:transform .15s ease,filter .15s ease!important;
}
@media (hover:hover) and (pointer:fine){
 html body #ca-center-backdrop.ca-library-only #ca-center button.ca-book-spine:hover {transform:translateY(-3px)!important;filter:brightness(1.12)!important;}
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-library-visit {
 position:absolute!important;z-index:4!important;left:4.5%!important;top:31%!important;width:25%!important;
 font-size:clamp(9px,1.25cqw,18px)!important;line-height:1.2!important;min-height:0!important;
 padding:.75cqw .55cqw!important;margin:0!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center [data-ca-pane="guardians"]>p:first-child,
html body #ca-center-backdrop.ca-library-only #ca-guardian-status,
html body #ca-center-backdrop.ca-library-only :is(.ca-library-pending,.ca-library-retry,.ca-library-empty) {
 position:absolute!important;left:4.5%!important;width:25%!important;z-index:3!important;box-sizing:border-box!important;
 margin:0!important;padding:.55cqw!important;border-radius:7px!important;background:#3c2349e8!important;
 color:#fff7df!important;text-align:center!important;font:600 clamp(8px,1.05cqw,15px)/1.25 'Trebuchet MS',sans-serif!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center [data-ca-pane="guardians"]>p:first-child{top:40%!important;}
html body #ca-center-backdrop.ca-library-only #ca-guardian-status{top:53%!important;}
html body #ca-center-backdrop.ca-library-only #ca-guardian-status:empty{display:none!important;}
html body #ca-center-backdrop.ca-library-only :is(.ca-library-pending,.ca-library-retry,.ca-library-empty){top:65%!important;}
html body #ca-center-backdrop.ca-library-only .ca-library-retry{cursor:pointer!important;pointer-events:auto!important;}


/* V9.9.72 — na Biblioteca dedicada, somente o contador fica na lateral.
   A Central, a Loja e o leitor de histórias não são afetados. */
html body #ca-center-backdrop.ca-library-only #ca-center [data-ca-pane="guardians"]>p:first-child,
html body #ca-center-backdrop.ca-library-only #ca-center #ca-guardian-status,
html body #ca-center-backdrop.ca-library-only #ca-center :is(.ca-shelf-intro,.ca-library-visit,.ca-library-pending,.ca-library-retry,.ca-library-empty) {
 display:none!important;
}

/* V9.9.73 — Botões X oficiais visíveis e contador logo abaixo do título.
   Não interfere na ordem/lombadas dos livros, aquisição ou leitura. */
html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title {
 left:50%!important;top:14.2%!important;width:max-content!important;max-width:58%!important;
 transform:translateX(-50%)!important;display:flex!important;justify-content:center!important;
 pointer-events:none!important;z-index:22!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-library-heading {
 width:auto!important;max-width:100%!important;align-items:center!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
 font-size:clamp(10px,1.15cqw,18px)!important;line-height:1.12!important;
 padding:.25cqw .85cqw!important;border-radius:8px!important;
 white-space:nowrap!important;max-width:100%!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center>.ca-head {
 z-index:35!important;pointer-events:none!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center>.ca-head>button.ca-close {
 appearance:none!important;position:absolute!important;
 top:2.5%!important;right:2%!important;left:auto!important;bottom:auto!important;
 display:block!important;box-sizing:border-box!important;
 width:clamp(48px,5.1cqw,70px)!important;height:clamp(40px,3.7cqw,50px)!important;
 min-width:48px!important;min-height:40px!important;
 max-width:none!important;max-height:none!important;
 padding:0!important;margin:0!important;flex:0 0 auto!important;
 background:transparent url('../ca-x-mapa-oficial-v9955.png') center / contain no-repeat!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 color:transparent!important;font-size:0!important;line-height:0!important;
 opacity:1!important;visibility:visible!important;pointer-events:auto!important;
 z-index:60!important;cursor:pointer!important;
}
/* Leitor original dos livros: converter o botão textual em X oficial,
   preservando o onclick que já executa storyDialog.close(). */
html body #ca-guardian-story-dialog .ca-story-reader>header {
 position:relative!important;padding-right:clamp(64px,10vw,94px)!important;
 min-height:58px!important;box-sizing:border-box!important;
}
html body #ca-guardian-story-dialog #ca-story-close {
 position:absolute!important;top:50%!important;right:10px!important;left:auto!important;
 transform:translateY(-50%)!important;
 display:block!important;box-sizing:border-box!important;
 width:clamp(48px,6vw,68px)!important;height:clamp(36px,4.5vw,48px)!important;
 min-width:48px!important;min-height:36px!important;max-width:none!important;max-height:none!important;
 padding:0!important;margin:0!important;
 background:transparent url('../ca-x-mapa-oficial-v9955.png') center / contain no-repeat!important;
 border:0!important;border-radius:0!important;box-shadow:none!important;
 color:transparent!important;font:0/0 Arial,sans-serif!important;text-shadow:none!important;
 opacity:1!important;visibility:visible!important;pointer-events:auto!important;
 z-index:20!important;cursor:pointer!important;
}
@media (hover:hover) and (pointer:fine) {
 html body #ca-guardian-story-dialog #ca-story-close:hover {
  transform:translateY(-50%) scale(1.06)!important;
  filter:brightness(1.12) drop-shadow(0 1px 5px rgba(255,228,122,.8))!important;
 }
}
html body #ca-guardian-story-dialog #ca-story-close:focus-visible,
html body #ca-center-backdrop.ca-library-only #ca-center>.ca-head>button.ca-close:focus-visible {
 outline:3px solid #ffe482!important;outline-offset:2px!important;
}
@media (max-width:700px) and (orientation:landscape) {
 html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title{top:13.7%!important;}
 html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count{font-size:clamp(8px,1.3cqw,12px)!important;}
 html body #ca-guardian-story-dialog .ca-story-reader>header {min-height:44px!important;padding-right:66px!important;}
 html body #ca-guardian-story-dialog #ca-story-close{right:5px!important;width:46px!important;height:34px!important;}
}


/* V9.9.76 — A arte oficial mantém as três prateleiras vazias.
   As lombadas são posicionadas pelo draw() do jogo com os desbloqueios
   individuais (12 + 12 + 1), mantendo imagens independentes e clicáveis.
   Apenas o Guia visual da Biblioteca utiliza estas coordenadas. */
html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title {
 left:6.0%!important;top:17.1%!important;width:16.7%!important;
 max-width:16.7%!important;height:4.6%!important;
 transform:none!important;display:flex!important;align-items:center!important;
 justify-content:center!important;pointer-events:none!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-library-heading {
 display:flex!important;align-items:center!important;justify-content:center!important;
 width:100%!important;height:100%!important;margin:0!important;padding:0!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
 display:block!important;box-sizing:border-box!important;
 background:transparent!important;border:0!important;box-shadow:none!important;
 padding:0!important;margin:0!important;max-width:100%!important;
 color:#28142b!important;text-shadow:0 1px 0 #fff0ac!important;
 font:900 clamp(8px,1.18cqw,20px)/1.1 'Trebuchet MS',sans-serif!important;
 white-space:nowrap!important;text-align:center!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center button.ca-book-spine {
 border:0!important;box-shadow:none!important;background:transparent!important;
 border-radius:0!important;padding:0!important;touch-action:manipulation!important;
}
@media (orientation:landscape) and (max-height:500px) {
 html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
   font-size:clamp(8px,1.20cqw,14px)!important;
 }
}


/* V9.9.77 — alinhamento real das lombadas na estante nova.
   A imagem da Biblioteca continua VAZIA; cada lombada é um elemento
   individual carregado pela coleção original do jogo (sem livros fixos).
   Apenas apresentação visual; lógica e inventário permanecem intactos. */
html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title {
 left:5.52%!important;top:17.45%!important;
 width:17.98%!important;max-width:17.98%!important;height:4.28%!important;
 transform:none!important;margin:0!important;padding:0!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 pointer-events:none!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
 width:100%!important;max-width:100%!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 height:100%!important;box-sizing:border-box!important;
 padding:0 .15cqw!important;margin:0!important;
 color:#182553!important;text-shadow:0 1px 1px #fff0a8!important;
 font-family:'Trebuchet MS',Arial,sans-serif!important;
 font-weight:900!important;font-size:clamp(7px,1.22cqw,21px)!important;
 line-height:1!important;letter-spacing:-.02em!important;white-space:nowrap!important;
 overflow:visible!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase button.ca-book-spine {
 border:0!important;box-shadow:none!important;background:transparent!important;
 border-radius:0!important;padding:0!important;margin:0!important;
 overflow:hidden!important;touch-action:manipulation!important;
 cursor:pointer!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase button.ca-book-spine img {
 border:0!important;box-shadow:none!important;pointer-events:none!important;
}
/* No hover on touch: avoid leaving a selected book visually raised. */
@media (hover:none) and (pointer:coarse) {
 html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase button.ca-book-spine:hover {
  transform:none!important;filter:none!important;
 }
}


/* V9.9.79 — texto do contador inteiro dentro da nova plaquinha dourada.
   Evitar recortes horizontais/verticais, inclusive mobile em landscape.
   Mantém o total e a atualização por estudante já existentes. */
html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title {
  left:5.35%!important; top:17.2%!important;
  width:18.35%!important; max-width:18.35%!important;
  height:4.7%!important; min-height:0!important;
  box-sizing:border-box!important;
  display:flex!important; align-items:center!important; justify-content:center!important;
  margin:0!important; padding:0!important;
  overflow:visible!important; line-height:normal!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-library-heading {
  box-sizing:border-box!important; width:100%!important; max-width:100%!important;
  height:100%!important; min-height:0!important;
  display:flex!important; align-items:center!important; justify-content:center!important;
  margin:0!important; padding:0!important; overflow:visible!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
  box-sizing:border-box!important; width:100%!important; max-width:100%!important;
  height:auto!important; min-height:0!important;
  margin:0!important; padding:0 .3cqw!important;
  display:block!important; text-align:center!important;
  font:900 clamp(9px,1.36cqw,18px)/1.32 'Trebuchet MS',Arial,sans-serif!important;
  letter-spacing:-.025em!important;
  color:#182553!important; text-shadow:0 1px 1px #fff0a8!important;
  white-space:nowrap!important; overflow:visible!important;
  text-overflow:clip!important;
  font-variant-numeric:tabular-nums!important;
}
@media (orientation:landscape) and (max-height:500px) {
  html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
    font-size:clamp(9px,1.36cqw,13px)!important;
    line-height:1.25!important;
  }
}


/* V9.9.80 — Plaquinha dourada da nova imagem (posição medida em 1670x942).
   Contador responsivo em unidades da própria biblioteca; não transborda em
   telas horizontais pequenas. O valor é preenchido pelo jogo. */
html body #ca-center-backdrop.ca-library-only #ca-center #ca-center-title {
  position:absolute!important;
  left:5.95%!important;top:18.20%!important;
  width:16.35%!important;max-width:16.35%!important;
  height:3.85%!important;min-height:0!important;
  transform:none!important;overflow:hidden!important;
  padding:0!important;margin:0!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  pointer-events:none!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center .ca-library-heading {
  position:relative!important;
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:100%!important;height:100%!important;min-width:0!important;
  padding:0!important;margin:0!important;overflow:hidden!important;
  font-size:0!important;line-height:0!important;
}
html body #ca-center-backdrop.ca-library-only #ca-center #ca-library-count {
  display:block!important;box-sizing:border-box!important;
  width:100%!important;max-width:100%!important;height:auto!important;
  margin:0!important;padding:0 1%!important;
  font:900 clamp(6px,1.1cqw,18px)/1.10 'Trebuchet MS',Arial,sans-serif!important;
  letter-spacing:-.03em!important;white-space:nowrap!important;
  color:#19224e!important;text-shadow:0 1px 0 #fff2b5!important;
  text-align:center!important;overflow:hidden!important;
  border:0!important;box-shadow:none!important;background:transparent!important;
  text-overflow:clip!important;font-variant-numeric:tabular-nums!important;
}
/* Dimensões dos botões vêm da geometria de cada prateleira no draw();
   mantemos o recorte artesanal de cada PNG, sem achatá-lo. */
html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase button.ca-book-spine {
  box-sizing:border-box!important;
  border:0!important;border-radius:0!important;
  padding:0!important;margin:0!important;
  box-shadow:none!important;background:transparent!important;
  overflow:hidden!important;touch-action:manipulation!important;
}

/* V14.1 — bases das lombadas apoiadas nas três prateleiras da arte 1670x942.
   A geometria da Biblioteca é calculada no draw() de index.html; CSS não altera
   quantidades, ordem, click, animação, proporções, imagens nem aquisições. */
html body #ca-center-backdrop.ca-library-only #ca-center .ca-bookcase button.ca-book-spine {
  transform-origin:50% 100%!important;
}
