/* ============================================================
   Álbum de Figurinhas — CSS consolidado até o E8
   (tokens + Estante E2 + Livro E3 + Páginas E4 + Conteúdo E5
    + Loja E7 + Placeholders + Compostas + PDF E8)
   ============================================================ */
/* ---------- E1 · Design tokens ---------- */
:root {
  --af-papel:      #F6F3EC;
  --af-papel-2:    #EFEAE0;
  --af-tinta:      #1C1B18;
  --af-tinta-suave:#6B675E;
  --af-acento:     #1F3D2B;
  --af-acento-2:   #A5712C;
  --af-linha:      rgba(28,27,24,.14);
  --af-fonte-display: "Fraunces", Georgia, serif;
  --af-fonte-corpo:   "Outfit", system-ui, sans-serif;
  --af-sombra-livro:  0 26px 50px -18px rgba(28,27,24,.38);
  --af-sombra-folha:  0 10px 24px -10px rgba(28,27,24,.3);
}
/* ============================================================
   E2 · ESTANTE (mobile-first)
   ============================================================ */
.af-biblioteca { max-width: 960px; margin: 0 auto; padding: 1rem; }
.af-biblioteca-titulo {
  font-family: var(--af-fonte-display);
  font-size: 1.8rem; margin: 0 0 1.5rem; color: var(--af-tinta);
}
.af-estante {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* mobile: 2 colunas */
  gap: 1.4rem;
}
.af-livro {
  position: relative;
  height: clamp(180px, 34vw, 240px);
  padding: .5rem .6rem;
  background: var(--af-tinta);
  color: var(--af-papel);
  border-radius: 4px 12px 12px 4px;        /* lombada arredondada */
  box-shadow: 0 18px 34px -18px rgba(0,0,0,.45);
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer;
  transform-origin: left center;
  transition: transform .3s ease, box-shadow .3s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.af-livro:active { transform: scale(.97); }  /* feedback de toque (mobile) */
.af-livro-titulo {
  font-family: var(--af-fonte-display);
  font-size: 1.05rem; line-height: 1.15; font-weight: 600;
  word-break: break-word;
}
.af-livro-progresso {
  display: block; height: 3px; width: 100%;
  background: rgba(246,243,236,.22); border-radius: 99px; overflow: hidden;
}
.af-livro-progresso::after {
  content: ""; display: block; height: 100%; width: var(--progresso, 0%);
  background: var(--af-acento-2); border-radius: 99px;
  transition: width .6s ease;
}
.af-livro-meta {
  font-family: var(--af-fonte-corpo);
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8;
}
.af-livro:focus-visible { outline: 2px solid var(--af-acento); outline-offset: 3px; }
@media (min-width: 640px) {
  .af-estante { grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
  .af-livro-titulo { font-size: 1.15rem; }
}
@media (min-width: 1024px) {
  .af-estante { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2rem; }
  .af-livro:hover { transform: rotateY(-14deg) translateX(-6px); box-shadow: 0 26px 44px -16px rgba(0,0,0,.5); }
  .af-livro:active { transform: rotateY(-14deg) translateX(-6px) scale(.98); }
}
/* ============================================================
   E3 · O LIVRO
   ============================================================ */
.af-leitor {
  margin-top: 2rem; padding: 1.2rem;
  background: linear-gradient(180deg, var(--af-papel), var(--af-papel-2));
  border-radius: 12px; box-shadow: 0 26px 50px -18px rgba(0,0,0,.38);
}
.af-fechar-livro {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem; border: 1px solid var(--af-linha); border-radius: 8px;
  background: #fff; color: var(--af-tinta);
  font-family: var(--af-fonte-corpo); font-weight: 600; cursor: pointer;
  margin-bottom: 1rem;
}
.af-livro-aberto {
  position: relative;
  perspective: 1800px;
  min-height: clamp(360px, 62vh, 560px);
  margin-top: 1.2rem;
}
/* Folhas: flip 3D (capa, páginas, prendas) */
.af-folha {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--af-papel), var(--af-papel-2));
  border-radius: 10px;
  box-shadow: var(--af-sombra-folha);
  padding: 1.4rem;
  box-sizing: border-box;
  transform-origin: left center;
  transform: rotateY(90deg);          /* fechada, invisível */
  opacity: 0;
  pointer-events: none;
  transition: transform .7s cubic-bezier(.4,.1,.2,1), opacity .35s ease;
  overflow-y: auto;
}
.af-folha.ativa { transform: rotateY(0); opacity: 1; pointer-events: auto; }
.af-folha.af-virando { pointer-events: none; }
/* Canto que dobra no hover (desktop) */
.af-folha::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 44px; height: 44px; pointer-events: none;
  background: linear-gradient(315deg, rgba(28,27,24,.16), transparent 55%);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  opacity: 0; transition: opacity .3s ease;
}
.af-folha:hover::after { opacity: 1; }
/* Capa */
.af-folha--capa {
  background: var(--af-tinta);
  color: var(--af-papel);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.af-capa-miolo { max-width: 420px; padding: 1rem; }
.af-capa-etiqueta {
  font-family: var(--af-fonte-corpo);
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--af-acento-2); display: block; margin-bottom: .6rem;
}
.af-capa-titulo {
  font-family: var(--af-fonte-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.1; margin: 0 0 .6rem;
}
.af-capa-sub { font-family: var(--af-fonte-corpo); color: rgba(246,243,236,.75); margin: 0 0 1.2rem; }
.af-capa-barra { height: 3px; background: rgba(246,243,236,.22); border-radius: 99px; overflow: hidden; margin-bottom: 1.4rem; }
.af-capa-barra span { display: block; height: 100%; background: var(--af-acento-2); border-radius: 99px; }
.af-capa-abrir {
  padding: .7rem 1.4rem; border: 1px solid var(--af-acento-2); border-radius: 8px;
  background: transparent; color: var(--af-papel);
  font-family: var(--af-fonte-corpo); font-weight: 600; cursor: pointer;
  transition: background .25s ease, color .25s ease;
}
.af-capa-abrir:hover { background: var(--af-acento-2); color: var(--af-tinta); }
/* Cabeçalho das folhas */
.af-folha-cabecalho {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--af-linha); padding-bottom: .6rem; margin-bottom: 1rem;
}
.af-folha-pagina-num { font-family: var(--af-fonte-display); font-size: 1.15rem; color: var(--af-tinta); }
.af-folha-pagina-meta { font-family: var(--af-fonte-corpo); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--af-tinta-suave); }
/* Grid dentro da folha (responsivo) */
.af-grid--folha {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: .7rem;
}
@media (min-width: 640px) { .af-grid--folha { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
/* Prendas */
.af-prendas-lista { list-style: none; padding: 0; margin: 0; }
.af-prendas-lista li { padding: .5rem 0; border-bottom: 1px dashed var(--af-linha); }
.af-prendas-vazio { color: var(--af-tinta-suave); }
/* ============================================================
   E4 · CANTOS CLICÁVEIS + ÍNDICE + SOMBRAS
   ============================================================ */
.af-canto {
  position: absolute; bottom: 6px;
  width: 58px; height: 58px;
  border: none; background: transparent;
  cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--af-tinta-suave);
  display: inline-flex; align-items: flex-end; justify-content: center;
  padding-bottom: .3rem;
  z-index: 5;
  transition: color .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
  border-radius: 10px;
}
.af-canto:hover { color: var(--af-acento); background: rgba(31,61,43,.06); }
.af-canto:disabled { opacity: .22; cursor: default; background: transparent; }
.af-canto--prev { left: 4px; }
.af-canto--next { right: 4px; }
/* Sombras realistas ao virar */
.af-folha.af-virando--frente { box-shadow: -22px 0 36px -14px rgba(28,27,24,.30); }
.af-folha.af-virando--tras  { box-shadow:  22px 0 36px -14px rgba(28,27,24,.30); }
/* Índice (pontinhos) */
.af-indice {
  display: flex; align-items: center; justify-content: center;
  gap: .45rem; flex-wrap: wrap; min-width: 60px;
}
.af-indice-item {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid var(--af-linha); background: transparent;
  padding: 0; cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.af-indice-item:hover { background: rgba(165,113,44,.35); }
.af-indice-item.ativo {
  background: var(--af-acento); border-color: var(--af-acento);
  transform: scale(1.25);
}
@media (min-width: 640px) {
  .af-indice-item { width: 12px; height: 12px; }
}
/* Navegação */
.af-leitor-nav {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  margin-top: 1.2rem; flex-wrap: wrap;
  position: relative; z-index: 6;
}
.af-nav-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--af-linha); background: #fff; color: var(--af-tinta);
  font-size: 1.3rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s ease, color .2s ease;
}
.af-nav-btn:hover { background: var(--af-acento); color: #fff; }
.af-leitor-contador { font-family: var(--af-fonte-corpo); font-size: .85rem; color: var(--af-tinta-suave); min-width: 48px; text-align: center; }
/* ============================================================
   E5 · CARDS REFINADOS + BOTÕES 44px
   ============================================================ */
.af-card {
  border: 1px solid var(--af-linha);
  border-radius: 10px;
  padding: .7rem .5rem .6rem;
  text-align: center;
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.af-card.af-colada { background: #f2f7f0; border-color: rgba(31,61,43,.35); }
.af-card.af-vazia  { background: #faf9f6; color: var(--af-tinta-suave); }
.af-card:focus-within { outline: 2px solid var(--af-acento); outline-offset: 2px; }
@media (min-width: 1024px) {
  .af-card:hover { transform: translateY(-3px); box-shadow: 0 10px 22px -12px rgba(28,27,24,.25); }
}
.af-card img {
  width: 100%; max-width: 96px; height: auto;
  border-radius: 6px; display: block; margin: 0 auto .45rem;
}
.af-img-colorida { box-shadow: 0 4px 10px -4px rgba(28,27,24,.35); }
.af-img-silhueta {
  filter: grayscale(100%) brightness(1.06);
  opacity: .38;
}
/* Número de posição (pista no slot vazio) */
.af-fig-num {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.9rem; font-weight: 800;
  color: var(--af-tinta-suave);
  line-height: 1; z-index: 2; pointer-events: none;
}
/* Botões com área de toque ≥ 44px */
.af-btn-colar, .af-btn-vender {
  width: 100%;
  min-height: 44px;
  padding: .55rem .6rem;
  border: none; border-radius: 8px;
  font-family: var(--af-fonte-corpo);
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem;
  transition: filter .2s ease, transform .15s ease;
}
.af-btn-colar  { background: var(--af-acento); color: #fff; }
.af-btn-vender { background: var(--af-acento-2); color: #fff; }
.af-btn-colar:hover, .af-btn-vender:hover { filter: brightness(1.08); }
.af-btn-colar:active, .af-btn-vender:active { transform: scale(.97); }
.af-btn-colar:focus-visible, .af-btn-vender:focus-visible {
  outline: 2px solid var(--af-tinta); outline-offset: 2px;
}
.af-card form { margin: .35rem 0 0; }
.af-card form + form { margin-top: .4rem; }
/* Placeholder configurável: figura de representação do álbum */
.af-img-representacao {
  opacity: 1;
  filter: none;
}
/* Slot vazio no modo "nenhuma imagem" (só número) */
.af-fig-area--numero {
  min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--af-linha);
  border-radius: 8px;
  background: #faf9f6;
}
.af-fig-area--numero .af-fig-num {
  position: static; transform: none;
}
/* ============================================================
   FIGURINHAS COMPOSTAS (tipos 1, 2, 3 e 4)
   ============================================================ */
.af-grid--folha {
  grid-auto-flow: dense;   /* encaixa blocos grandes sem buracos */
}
.af-composto { position: relative; overflow: hidden; border-radius: 10px; }
.af-composto--tipo2 { grid-column: span 2; }
.af-composto--tipo3 { grid-row: span 2; }
.af-composto--tipo4 { grid-column: span 2; grid-row: span 2; }
.af-composto-grid {
  display: grid;
  gap: 0;
  height: 100%;
}
.af-composto--tipo2 .af-composto-grid { grid-template-columns: 1fr 1fr; }
.af-composto--tipo3 .af-composto-grid { grid-template-rows: 1fr 1fr; }
.af-composto--tipo4 .af-composto-grid {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "p1 p2"
    "p3 p4";
}
.af-composto--tipo4 .af-card[data-posicao="1"] { grid-area: p1; }
.af-composto--tipo4 .af-card[data-posicao="2"] { grid-area: p2; }
.af-composto--tipo4 .af-card[data-posicao="3"] { grid-area: p3; }
.af-composto--tipo4 .af-card[data-posicao="4"] { grid-area: p4; }
.af-composto .af-card {
  border: none; border-radius: 0;
  background: transparent; box-shadow: none;
  padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.af-composto .af-card img {
  width: 100%; max-width: none; height: auto;
  border-radius: 0; margin: 0;
}
.af-composto--completo { border: 2px solid var(--af-acento-2); }
.af-composto--completo .af-card { opacity: 1; }
.af-composto-full {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 3; border-radius: 8px;
  animation: af-fade-in .6s ease;
}
@keyframes af-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@media (max-width: 480px) {
  .af-composto--tipo4 { grid-column: span 2; }
}
/* ============================================================
   E7 · LOJA (balcão editorial)
   ============================================================ */
.af-loja { max-width: 960px; margin: 0 auto; padding: 1rem; }
.af-balcao {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--af-linha);
  padding-bottom: 1.4rem; margin-bottom: 2rem;
}
.af-balcao-etiqueta {
  font-family: var(--af-fonte-corpo);
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--af-acento-2); display: block; margin-bottom: .4rem;
}
.af-balcao-titulo {
  font-family: var(--af-fonte-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0; color: var(--af-tinta);
}
.af-balcao-saldo {
  text-align: right;
  background: var(--af-tinta); color: var(--af-papel);
  border-radius: 12px; padding: .8rem 1.2rem; min-width: 120px;
}
.af-balcao-saldo-rotulo {
  display: block; font-family: var(--af-fonte-corpo);
  font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(246,243,236,.65);
}
.af-balcao-saldo-valor {
  font-family: var(--af-fonte-display); font-size: 1.4rem; color: var(--af-acento-2);
}
.af-envelope-card {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  border: 1px solid var(--af-linha); border-radius: 14px;
  padding: 1.3rem 1.4rem; margin-bottom: 1rem;
  background: #fff;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.af-envelope-card--misto { border-left: 4px solid var(--af-acento); }
@media (min-width: 1024px) {
  .af-envelope-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -16px rgba(28,27,24,.28); }
}
.af-envelope-tag {
  font-family: var(--af-fonte-corpo);
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--af-acento-2); display: block; margin-bottom: .35rem;
}
.af-envelope-titulo { font-family: var(--af-fonte-display); font-size: 1.25rem; margin: 0 0 .3rem; color: var(--af-tinta); }
.af-envelope-desc { font-family: var(--af-fonte-corpo); color: var(--af-tinta-suave); margin: 0; font-size: .95rem; }
.af-envelope-acao { display: flex; align-items: center; gap: 1rem; }
.af-envelope-custo { font-family: var(--af-fonte-display); font-size: 1.1rem; color: var(--af-tinta); white-space: nowrap; }
.af-btn-envelope {
  min-height: 44px; padding: .6rem 1.2rem;
  border: none; border-radius: 8px;
  background: var(--af-acento); color: #fff;
  font-family: var(--af-fonte-corpo); font-weight: 600; font-size: .92rem;
  cursor: pointer;
  transition: filter .2s ease, transform .15s ease;
}
.af-btn-envelope:hover { filter: brightness(1.08); }
.af-btn-envelope:active { transform: scale(.97); }
.af-btn-envelope:focus-visible { outline: 2px solid var(--af-tinta); outline-offset: 2px; }
.af-avulsas { margin-top: 2.2rem; }
.af-avulsas-titulo {
  font-family: var(--af-fonte-display); font-size: 1.4rem; color: var(--af-tinta);
  border-bottom: 1px solid var(--af-linha); padding-bottom: .6rem; margin-bottom: 1.2rem;
}
.af-avulsas-vazio { color: var(--af-tinta-suave); }
.af-avulsa-item {
  border: 1px solid var(--af-linha); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: .9rem; background: #fff;
}
.af-avulsa-cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.af-avulsa-cabecalho h3 { font-family: var(--af-fonte-display); font-size: 1.1rem; margin: 0; color: var(--af-tinta); }
.af-avulsa-status {
  font-family: var(--af-fonte-corpo); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--af-tinta-suave);
  border: 1px solid var(--af-linha); border-radius: 99px; padding: .25rem .7rem;
}
.af-avulsa-status--aberta { color: var(--af-acento); border-color: rgba(31,61,43,.4); background: #f2f7f0; }
.af-avulsa-info { font-family: var(--af-fonte-corpo); color: var(--af-tinta-suave); margin: .6rem 0 0; }
.af-avulsa-janelas { list-style: none; padding: 0; margin: .6rem 0 0; }
.af-avulsa-janelas li { font-size: .85rem; color: var(--af-tinta-suave); padding: .3rem 0; border-top: 1px dashed var(--af-linha); }
/* ============================================================
   E8 · CELEBRAÇÃO + BOTÃO PDF
   ============================================================ */
.af-celebracao {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(28,27,24,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.af-celebracao-box {
  background: var(--af-papel);
  color: var(--af-tinta);
  border-radius: 16px;
  padding: 2rem 2.2rem;
  text-align: center;
  max-width: 420px; width: 100%;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
}
.af-celebracao-tag {
  font-family: var(--af-fonte-corpo);
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--af-acento-2); display: block; margin-bottom: .6rem;
}
.af-celebracao-box h3 {
  font-family: var(--af-fonte-display);
  font-size: 1.6rem; margin: 0 0 .5rem;
}
.af-celebracao-box p { color: var(--af-tinta-suave); margin: 0 0 .8rem; }
.af-celebracao-codigo strong { color: var(--af-acento); }
.af-btn-pdf {
  display: inline-block; margin-top: .6rem;
  padding: .7rem 1.4rem; border-radius: 8px;
  background: var(--af-acento); color: #fff;
  font-family: var(--af-fonte-corpo); font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: filter .2s ease, transform .15s ease;
}
.af-btn-pdf:hover { filter: brightness(1.08); }
.af-btn-pdf:active { transform: scale(.97); }
.af-btn-pdf:focus-visible { outline: 2px solid var(--af-tinta); outline-offset: 2px; }
.af-prendas-pdf { margin-top: 1.2rem; text-align: center; }
/* ============================================================
   (ABAIXO: CSS original da Loja/Envelope — NÃO REMOVER)
   ============================================================ */
.af-overlay[hidden] { display: none !important; }
.af-loja, .af-album, .af-pontos { max-width: 900px; margin: 0 auto; }
.af-saldo { font-size: 1.15rem; margin: 1rem 0; }
.af-painel { border: 1px solid #e0e0e0; border-radius: 10px;
             padding: 1rem 1.2rem; margin: 1rem 0; }
.af-painel h2 { margin-top: 0; }
.af-aberta { color: #1b5e20; font-weight: 600; }
.af-janelas { list-style: none; padding: 0; }
.af-janelas li { padding: .4rem 0; border-bottom: 1px dashed #eee; }
.af-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem;
           border-bottom: 2px solid #e0e0e0; }
.af-tab { padding: .6rem 1.2rem; border: 1px solid #ddd; border-bottom: none;
          border-radius: 8px 8px 0 0; background: #f5f5f5; cursor: pointer;
          font-weight: 600; }
.af-tab.ativo { background: #1976d2; color: #fff; border-color: #1976d2; }
.af-tab-painel { display: none; }
.af-tab-painel.ativo { display: block; }
.af-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.85);
              display: flex; flex-direction: column; align-items: center;
              justify-content: center; z-index: 9999; color: #fff; }
.af-pacote { width: 140px; height: 100px; background: #1976d2;
             border-radius: 8px; position: relative;
             transition: transform .9s ease, opacity .5s ease; }
.af-pacote.aberto { transform: rotateX(60deg) scale(1.1); }
.af-pacote.sumir { opacity: 0; transform: scale(.5); }
.af-pacote-frente { position: absolute; inset: 0; display: flex;
                    align-items: center; justify-content: center; font-weight: 700; }
.af-figurinhas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    margin-top: 1rem;
    max-height: 55vh;
    overflow-y: auto;
    padding: .4rem;
}
.af-fig-card {
    perspective: 900px;
    position: relative;
    width: 143px;
    height: 195px;
    flex-shrink: 0;
}
.af-fig-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .8s ease;
}
.af-fig-card.revelar .af-fig-inner {
    transform: rotateY(180deg);
}
.af-fig-frente,
.af-fig-verso {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: .4rem;
    box-sizing: border-box;
}
.af-fig-frente {
    background: #1976d2;
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
}
.af-fig-verso {
    background: #fff;
    color: #333;
    transform: rotateY(180deg);
}
.af-fig-verso img {
    max-width: 104px;
    max-height: 104px;
    width: auto;
    height: auto;
    border-radius: 4px;
    object-fit: contain;
}
.af-fig-codigo { font-weight: 700; margin-top: .2rem; font-size: .8rem; }
.af-fig-titulo { font-size: .7rem; color: #666; text-align: center; }
.af-fig-nova { color: #2e7d32; font-weight: 700; font-size: .7rem; }
.af-fig-dup { color: #f9a825; font-weight: 700; font-size: .7rem; }
.af-fig-card.revelar .af-fig-verso {
    animation: af-brilho .9s ease;
}
@keyframes af-brilho {
    0%   { box-shadow: 0 0 0 rgba(255,255,255,0); }
    40%  { box-shadow: 0 0 30px 8px rgba(255,255,255,.9); }
    100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
}
.af-resultado { margin-top: 1.2rem; text-align: center; }
.af-btn-fechar { margin-top: 1rem; padding: .6rem 1.4rem; border: none;
                 border-radius: 6px; cursor: pointer; background: #fff;
                 color: #333; font-weight: 600; }
.af-fig-area {
    position: relative;
    display: inline-block;
}
.af-fig-verso {
    position: relative;
}
.af-fig-dup {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}
/* ============================================================
   LOJA — REFORÇO VISUAL (botão herói, saldo, cards, resgate)
   ============================================================ */
/* 1) Botão "Abrir envelope" — CTA principal em destaque */
.af-btn-envelope {
    background: linear-gradient(135deg, #A5712C 0%, #D4A24E 100%);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .02em;
    box-shadow: 0 4px 14px rgba(165,113,44,.35);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.af-btn-envelope:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(165,113,44,.45);
}
.af-btn-envelope:active {
    transform: translateY(0);
}
/* 2) Saldo — destaque com ícone e cor */
.af-balcao-saldo-valor {
    font-size: 22px;
    font-weight: 800;
    color: #A5712C;
}
.af-balcao-saldo-valor::before {
    content: "★ ";
    color: #D4A24E;
}
/* 3) Avulsas — de lista para cards com capa */
.af-avulsa-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: box-shadow .2s ease, transform .2s ease;
}
.af-avulsa-item:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.10);
    transform: translateY(-2px);
}
.af-avulsa-cabecalho h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1A1A1A;
}
.af-avulsa-status--aberta {
    background: #E8F5E9;
    color: #2E7D32;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
/* 4) Resgate de código — container com fundo suave */
.af-resgate {
    background: #FAF7F2;
    border: 1px solid #EFE6D8;
    border-radius: 14px;
    padding: 20px;
    margin-top: 24px;
}
.af-resgate-form {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.af-resgate-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D8CBB5;
    border-radius: 8px;
    font-size: 14px;
}
.af-btn-resgate {
    background: #1A1A1A;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.af-btn-resgate:hover {
    background: #333;
}
/* 5) Brilho ao clicar em "Abrir envelope" (ativa com .is-abrindo via JS) */
.af-btn-envelope.is-abrindo {
    animation: af-brilho-dourado .5s ease;
}
@keyframes af-brilho-dourado {
    0%   { box-shadow: 0 0 0 0 rgba(212,162,78,.6); }
    100% { box-shadow: 0 0 0 18px rgba(212,162,78,0); }
}
/* ============================================================
   ÁLBUM — REFORÇO VISUAL (versão clara, textos dourados)
   ============================================================ */
/* Livro aberto e folhas — fundo claro com sombra suave */
.af-livro-aberto {
    background: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.10);
}
.af-folha {
    background: #FFFFFF;
    box-shadow: inset 0 0 30px rgba(0,0,0,.04);
}
/* CAPA escura preservada (design original).
   Para capa clara também, apague as 3 linhas abaixo. */
.af-folha--capa {
    background: var(--af-tinta);
    color: var(--af-papel);
}
/* Progresso com presença — número em destaque */
.af-capa-sub {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .02em;
}
.af-capa-sub strong {
    font-size: 26px;
    font-weight: 800;
    color: #D4A24E;
}
/* Barra de progresso "premiada" — gradiente + brilho */
.af-capa-barra {
    height: 10px;
    border-radius: 20px;
    overflow: hidden;
    margin: 14px 0;
}
.af-capa-barra span {
    background: linear-gradient(90deg, #A5712C 0%, #D4A24E 60%, #F0D9A0 100%);
    height: 100%;
    display: block;
    border-radius: 20px;
    box-shadow: 0 0 12px rgba(212,162,78,.6);
    transition: width .6s ease;
}
/* Botão "Abrir álbum" em destaque (CTA da capa) */
.af-capa-abrir {
    background: linear-gradient(135deg, #A5712C 0%, #D4A24E 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(165,113,44,.35);
    transition: transform .15s ease, box-shadow .15s ease;
}
.af-capa-abrir:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(165,113,44,.45);
}
/* Texto das figurinhas — maior, em bold, dourado âmbar */
.af-card strong {
    font-size: 15px;
    font-weight: 700;
    color: #A5712C;
    letter-spacing: .02em;
}
.af-fig-titulo {
    font-size: 14px;
    font-weight: 700;
    color: #A5712C;
    line-height: 1.25;
    margin-top: 4px;
}
.af-fig-num {
    color: #A5712C;
    font-weight: 700;
}

/* ETAPA 4 — figurinha especial no álbum virtual */
.af-img-especial { width: 100%; height: auto; display: block; }
.af-fig-num--especial {
    font-family: 'Georgia', serif; font-weight: 700; font-size: 12px;
    color: #A5712C; text-shadow: 0 0 2px #fff, 0 0 3px #fff;
    white-space: nowrap; z-index: 3; pointer-events: none;
}
.af-badge-especial {
    position: absolute; top: 6px; right: 6px; z-index: 4;
    width: 26px; height: 26px; line-height: 26px; text-align: center;
    background: linear-gradient(135deg, #F5D67B, #C9971E);
    color: #fff; border-radius: 50%; font-size: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: none;
}

.af-premiada-box {
    margin-top: 16px;
    padding: 16px;
    border: 2px dashed #d4a017;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff9e6, #fff3cc);
    text-align: center;
    animation: af-premiada-pop .5s ease;
}
.af-premiada-selo {
    display: inline-block;
    background: #d4a017;
    color: #fff;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 4px 14px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.af-premiada-img {
    max-width: 140px;
    border-radius: 10px;
    display: block;
    margin: 0 auto 8px;
}
.af-premiada-codigo {
    font-size: 18px;
    font-weight: 700;
    color: #8a6d00;
    letter-spacing: .06em;
}
.af-premiada-titulo { font-size: 14px; color: #555; margin: 2px 0 8px; }
.af-premiada-link {
    display: inline-block;
    margin-top: 6px;
    background: #d4a017;
    color: #fff;
    padding: 8px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}
.af-premiada-link:hover { background: #b8890f; color: #fff; }
.af-premiada-validade { font-size: 12px; color: #999; margin-top: 6px; }
@keyframes af-premiada-pop {
    0% { transform: scale(.6); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.af-premiada-box--aviso {
    border-color: #9e9e9e;
    background: linear-gradient(135deg, #f5f5f5, #ececec);
}
.af-premiada-box--aviso .af-premiada-selo {
    background: #757575;
}

/* ============================================================
   TIPOS DE PACOTE — botões na loja
   ============================================================ */
.af-envelope-acao {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.af-btn-envelope.af-btn-pacote {
    background: #7b1fa2;
    color: #fff;
    border: 1px solid #6a1b9a;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.af-btn-envelope.af-btn-pacote:hover {
    background: #5e1186;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,.18);
}

.af-btn-envelope.af-btn-pacote:disabled {
    background: #b39ddb;
    cursor: not-allowed;
}

/* Empilha os botões no celular, sem estourar o card */
@media (max-width: 600px) {
    .af-envelope-acao {
        flex-direction: column;
        align-items: stretch;
    }
    .af-btn-envelope.af-btn-pacote {
        text-align: center;
        width: 100%;
    }
}

/* Botão de PDF individual da figurinha */
.af-btn-fig-pdf {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #A5712C;
    background: #fff;
    border: 1px solid #A5712C;
    border-radius: 6px;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.af-btn-fig-pdf:hover {
    background: #A5712C;
    color: #fff;
    text-decoration: none;
}

/* Controle de QRCode no PDF do álbum */
.af-pdf-controle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.af-pdf-qr-opcao {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6B675E;
    cursor: pointer;
    user-select: none;
}
.af-pdf-qr-opcao input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #A5712C;
}

/* ============================================================
   PDF INDIVIDUAL DA FIGURINHA — controles empilhados e centrados
   ============================================================ */
/* Controles do PDF individual — empilhados em QUALQUER contexto.
   A dupla de seletores (com e sem pai) garante vitória sobre
   a regra .af-composto .af-card que também aplica flex. */
.af-fig-pdf-controle,
.af-card .af-fig-pdf-controle,
.af-composto .af-card .af-fig-pdf-controle {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    margin: 10px 0 4px 0;
    padding: 0;
    text-align: center;
    box-sizing: border-box;
}

/* Cada filho na própria linha, sem encolher nem esticar */
.af-fig-pdf-controle > .af-btn-fig-pdf,
.af-fig-pdf-controle > .af-fig-pdf-qr,
.af-fig-pdf-controle > .af-fig-pdf-so {
    flex: 0 0 auto;
    align-self: center;
    width: auto;
    max-width: 100%;
    margin: 0;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Botão do PDF */
.af-fig-pdf-controle > .af-btn-fig-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 6px 14px;
    font-size: 11px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    border-radius: 999px;
}

/* Checkboxes (QR e Só imagem) — mesmo peso visual */
.af-fig-pdf-qr,
.af-fig-pdf-so {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 10px;
    line-height: 1.2;
    color: #6B675E;
    cursor: pointer;
    user-select: none;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
}

.af-fig-pdf-qr input,
.af-fig-pdf-so input {
    width: 13px;
    height: 13px;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
    accent-color: #A5712C;
}

/* Mobile: botão mais largo, labels um pouco maiores */
@media (max-width: 480px) {
    .af-fig-pdf-controle { gap: 10px; }
    .af-fig-pdf-controle > .af-btn-fig-pdf {
        width: 100%;
        max-width: 220px;
        padding: 9px 14px;
    }
    .af-fig-pdf-qr,
    .af-fig-pdf-so {
        font-size: 11px;
        padding: 4px 12px;
    }
    .af-fig-pdf-qr input,
    .af-fig-pdf-so input {
        width: 15px;
        height: 15px;
    }
}
