/* ============================================================
   VilaTCG — app de binder
   ============================================================ */

.app-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px clamp(12px, 3vw, 32px) 90px;
  position: relative;
  z-index: 1;
}

/* ---------- barra superior ---------- */
.app-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 18px;
  flex-wrap: wrap;
}
.app-bar .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--cream-dim);
  font-weight: 700;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(226,174,73,.25);
  background: rgba(26,39,71,.5);
  transition: border-color .2s, color .2s;
}
.app-bar .back-link:hover { border-color: var(--gold); color: var(--gold-hi); }

.app-bar .brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  text-decoration: none;
  margin-right: auto;
  display: inline-flex;
  align-items: center;
}
.app-bar .brand .vila { color: var(--ruby); }
.app-bar .brand-logo {
  height: 64px;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.55));
  transition: transform .2s ease;
}
.app-bar .brand:hover .brand-logo { transform: scale(1.05); }
@media (max-width: 640px) {
  .app-bar .brand-logo { height: 42px; }
}

/* ---------- botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 9px;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .02em;
  padding: 11px 18px;
  transition: filter .2s, transform .15s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-gold {
  color: var(--night);
  background: linear-gradient(160deg, var(--gold-hi) 0%, var(--gold) 55%, #c78d33 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 16px -6px rgba(226,174,73,.55);
}
.btn-gold:hover { filter: brightness(1.08); }

.btn-ruby {
  color: #fff;
  background: linear-gradient(160deg, var(--ruby-hi) 0%, var(--ruby) 60%, #9c1c3e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 16px -6px rgba(217,46,90,.5);
}
.btn-ruby:hover { filter: brightness(1.08); }

.btn-ghost {
  color: var(--cream-dim);
  background: rgba(26,39,71,.55);
  border: 1px solid rgba(226,174,73,.3);
}
.btn-ghost:hover { color: var(--gold-hi); border-color: var(--gold); }

.btn-danger-ghost {
  color: #ff8ba1;
  background: transparent;
  border: 1px solid rgba(217,46,90,.4);
}
.btn-danger-ghost:hover { border-color: var(--ruby-hi); color: var(--ruby-hi); }

.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 7px; }

/* ============================================================
   TELA 1 — escolha de formato / meus binders
   ============================================================ */
.screen-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  text-align: center;
  margin-top: clamp(10px, 3vw, 30px);
  letter-spacing: .03em;
}
.screen-sub { text-align: center; color: var(--muted); margin: 10px auto 0; max-width: 52ch; }

/* vitrine das artes de página inteira */
.art-promo {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  margin: clamp(24px, 4vw, 40px) 0 0;
  padding: clamp(16px, 3vw, 26px);
  border-radius: var(--radius);
  border: 1px solid rgba(226,174,73,.4);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(217,46,90,.14), transparent 55%),
    linear-gradient(180deg, rgba(34,51,94,.55), rgba(17,26,48,.8));
  animation: rise-in .5s cubic-bezier(.2,.8,.2,1) both;
}
.ap-thumbs { display: flex; flex: none; padding: 0 10px; }
.ap-thumbs:empty { display: none; }
.ap-thumbs img {
  width: clamp(76px, 10vw, 110px);
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(226,174,73,.55);
  box-shadow: 0 12px 26px -10px rgba(0,0,0,.8);
  background: rgba(12,18,34,.6);
}
.ap-thumbs img + img { margin-left: -30px; }
.ap-thumbs img:nth-child(1) { transform: rotate(-7deg) translateY(4px); }
.ap-thumbs img:nth-child(2) { transform: rotate(1deg) translateY(-6px); z-index: 1; }
.ap-thumbs img:nth-child(3) { transform: rotate(8deg) translateY(5px); }
.ap-text h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.12rem, 2.6vw, 1.45rem);
  letter-spacing: .03em;
  margin: 0 0 8px;
  color: var(--cream);
}
.ap-text p { color: var(--cream-dim); font-size: .93rem; line-height: 1.6; margin: 0 0 10px; }
.ap-text p b { color: var(--cream); }
.ap-pdf {
  padding: 9px 13px;
  border-radius: 8px;
  background: rgba(226,174,73,.1);
  border: 1px dashed rgba(226,174,73,.45);
}
@media (max-width: 640px) {
  .art-promo { flex-direction: column; text-align: center; }
  .ap-thumbs { padding-top: 6px; }
}

/* chama o olho para o botão de arte no editor */
#btnPageArt { animation: art-glow 2.8s ease-in-out infinite; }
@keyframes art-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,46,90,0); }
  50% { box-shadow: 0 0 16px 2px rgba(217,46,90,.45); }
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(28px, 5vw, 44px) 0 18px;
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(226,174,73,.5), transparent); }

/* meus binders salvos */
.saved-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.saved-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(34,51,94,.55), rgba(17,26,48,.7));
  border: 1px solid rgba(226,174,73,.25);
  animation: rise-in .5s cubic-bezier(.2,.8,.2,1) both;
}
.saved-item .mini-grid {
  display: grid;
  gap: 2px;
  width: 44px;
  flex: none;
}
.saved-item .mini-grid i { background: rgba(226,174,73,.4); border-radius: 2px; aspect-ratio: 63/88; }
.saved-item .info { min-width: 0; flex: 1; }
.saved-item .info b { display: block; font-size: 1.05rem; color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved-item .info span { font-size: .82rem; color: var(--muted); }
.saved-item .actions { display: flex; gap: 8px; flex: none; }

/* grade de formatos */
.formats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: clamp(12px, 2vw, 20px);
}
.format-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 14px 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(34,51,94,.5), rgba(17,26,48,.75));
  border: 1px solid rgba(226,174,73,.22);
  color: var(--cream);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  animation: rise-in .5s cubic-bezier(.2,.8,.2,1) both;
}
.format-card:nth-child(2) { animation-delay: .06s; }
.format-card:nth-child(3) { animation-delay: .12s; }
.format-card:nth-child(4) { animation-delay: .18s; }
.format-card:nth-child(5) { animation-delay: .24s; }
.format-card:nth-child(6) { animation-delay: .3s; }
.format-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.7), 0 0 28px -10px rgba(226,174,73,.4);
}

.format-card .fmt-grid { display: grid; gap: 4px; }
.format-card .fmt-grid i {
  width: clamp(16px, 2.2vw, 22px);
  aspect-ratio: 63/88;
  border-radius: 3px;
  background: linear-gradient(160deg, var(--plate-hi), var(--navy));
  border: 1px solid rgba(226,174,73,.55);
}
.format-card .fmt-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .05em;
}
.format-card .fmt-pockets { font-size: .8rem; color: var(--muted); margin-top: -8px; }

/* ============================================================
   TELA 2 — editor
   ============================================================ */
.editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.binder-name-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.binder-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 3.4vw, 1.8rem);
  letter-spacing: .02em;
  color: var(--cream);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  min-width: 60px;
  max-width: 100%;
  padding: 2px 4px;
}
.binder-name:hover, .binder-name:focus { border-bottom-color: rgba(226,174,73,.5); outline: none; }
.binder-badge {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .16em;
  color: var(--gold);
  border: 1px solid rgba(226,174,73,.45);
  border-radius: 99px;
  padding: 4px 12px;
  white-space: nowrap;
}
.editor-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* estatísticas */
.binder-stats {
  display: flex;
  gap: 18px;
  font-size: .85rem;
  color: var(--muted);
  margin: 2px 0 14px;
  flex-wrap: wrap;
}
.binder-stats b { color: var(--gold-hi); font-size: 1rem; }

/* moldura da página do binder */
.binder-stage { display: flex; justify-content: center; }
.binder-page {
  position: relative;
  width: 100%;
  padding: clamp(14px, 2.6vw, 26px);
  border-radius: 18px;
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(44,66,118,.5) 0%, transparent 60%),
    linear-gradient(180deg, #1a2747 0%, #131c33 100%);
  border: 1px solid rgba(226,174,73,.3);
  box-shadow: var(--shadow-card), inset 0 0 60px rgba(0,0,0,.35);
}
/* cantoneiras douradas — assinatura */
.binder-page::before, .binder-page::after,
.binder-page .corner::before, .binder-page .corner::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border: 3px solid var(--gold);
  pointer-events: none;
}
.binder-page::before { top: 7px; left: 7px; border-right: none; border-bottom: none; border-top-left-radius: 12px; }
.binder-page::after  { top: 7px; right: 7px; border-left: none; border-bottom: none; border-top-right-radius: 12px; }
.binder-page .corner::before { bottom: 7px; left: 7px; border-right: none; border-top: none; border-bottom-left-radius: 12px; }
.binder-page .corner::after  { bottom: 7px; right: 7px; border-left: none; border-top: none; border-bottom-right-radius: 12px; }

.pockets {
  display: grid;
  --gap: clamp(8px, 1.6vw, 14px);
  gap: var(--gap);
  animation: page-turn .45s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes page-turn {
  from { opacity: 0; transform: rotateY(-8deg) translateX(18px); }
  to   { opacity: 1; transform: none; }
}
.pockets.turn-back { animation-name: page-turn-back; }
@keyframes page-turn-back {
  from { opacity: 0; transform: rotateY(8deg) translateX(-18px); }
  to   { opacity: 1; transform: none; }
}

/* bolso */
.pocket {
  position: relative;
  aspect-ratio: 65 / 90;
  border-radius: 8px;
  border: 2px dashed rgba(226,174,73,.35);
  background:
    radial-gradient(90% 70% at 50% 20%, rgba(44,66,118,.35), transparent 70%),
    rgba(12,18,34,.55);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

/* bolso duplo: ocupa duas colunas; a altura vem do medidor invisível */
.pocket.wide { aspect-ratio: auto; }
.pocket .ratio-keeper {
  display: block;
  width: calc(50% - var(--gap, 12px) / 2);   /* o JS recalcula para a largura real */
  visibility: hidden;
  pointer-events: none;
}
/* uma célula por fileira coberta, com o vão entre elas */
.pocket .ratio-keeper b { display: block; aspect-ratio: 65 / 90; }
.pocket .ratio-keeper b + b { margin-top: var(--gap, 12px); }

/* botão de unir (no vão) / separar (na emenda do bolso duplo) */
.pocket .link-btn {
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 22px; height: 22px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  color: var(--night);
  background: linear-gradient(160deg, var(--gold-hi), var(--gold));
  border: 1px solid rgba(12,18,34,.55);
  box-shadow: 0 3px 10px -2px rgba(0,0,0,.75);
  opacity: .4;
  transition: opacity .18s ease, scale .18s ease;
}
.pocket .link-btn.merge { right: 0; transform: translate(calc(50% + var(--gap, 12px) / 2), -50%); }
/* separar: no alto, centrado — não briga com o "+" do bolso vazio nem com o ↕ */
.pocket .link-btn.split { left: 50%; top: 7%; transform: translateX(-50%); }
/* unir com o bolso de baixo: no vão inferior */
.pocket .link-btn.merge-v { left: 50%; top: auto; bottom: 0; transform: translate(-50%, calc(50% + var(--gap, 12px) / 2)); }
.pocket:hover .link-btn { opacity: .9; }
.pocket .link-btn:hover, .pocket .link-btn:focus-visible { opacity: 1; scale: 1.18; }
.pocket.menu-open .link-btn { display: none; }
@media (hover: none) {
  .pocket .link-btn { opacity: .8; width: 26px; height: 26px; font-size: .85rem; }
}
.pocket:hover, .pocket.menu-open {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(226,174,73,.3), 0 8px 22px -10px rgba(0,0,0,.7);
}
.pocket.filled { border-style: solid; border-color: rgba(226,174,73,.5); }
.pocket .pocket-num {
  position: absolute;
  top: 6px; left: 8px;
  font-size: .68rem;
  font-weight: 800;
  color: rgba(226,174,73,.55);
  letter-spacing: .08em;
  z-index: 1;
  pointer-events: none;
}
.pocket.filled .pocket-num { display: none; }

.pocket .empty-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(226,174,73,.4);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 300;
  pointer-events: none;
  transition: color .2s, transform .2s;
}
.pocket:hover .empty-hint { color: var(--gold); transform: scale(1.15); }

.pocket img.slot-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  animation: slot-in .4s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes slot-in {
  from { opacity: 0; transform: scale(.7) rotate(-4deg); }
  to   { opacity: 1; transform: none; }
}

/* menu do bolso */
.pocket-menu {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  padding: 10%;
  background: rgba(12,18,34,.88);
  backdrop-filter: blur(2px);
  border-radius: 6px;
  animation: fade-in .15s ease both;
}
/* em bolso largo o menu fica com botões lado a lado (alto e estreito segue em coluna) */
.pocket.wide:not(.w1) .pocket-menu { flex-direction: row; justify-content: center; padding: 8%; }
.pocket.wide:not(.w1) .pocket-menu button { flex: 0 1 auto; padding: 8px 12px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.pocket-menu button {
  border: 1px solid rgba(226,174,73,.4);
  background: rgba(34,51,94,.8);
  color: var(--cream);
  font-weight: 700;
  font-size: clamp(.68rem, 1.5vw, .85rem);
  border-radius: 7px;
  padding: 8px 6px;
  transition: background .15s, border-color .15s;
}
.pocket-menu button:hover { background: var(--plate-hi); border-color: var(--gold); }
.pocket-menu button.danger { color: #ff8ba1; border-color: rgba(217,46,90,.5); }
.pocket-menu button.danger:hover { background: rgba(217,46,90,.2); border-color: var(--ruby-hi); }

/* navegação de páginas */
.pages-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.page-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(226,174,73,.4);
  background: rgba(26,39,71,.6);
  color: var(--gold-hi);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: border-color .2s, background .2s;
}
.page-arrow:hover:not(:disabled) { border-color: var(--gold); background: var(--plate); }
.page-indicator { font-weight: 800; color: var(--cream-dim); letter-spacing: .06em; font-size: .95rem; min-width: 110px; text-align: center; }
.page-indicator b { color: var(--gold-hi); }

/* ============================================================
   MODAIS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6,10,20,.78);
  backdrop-filter: blur(4px);
  animation: fade-in .2s ease both;
}
.modal {
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(180deg, #1c2949 0%, #111a30 100%);
  border: 1px solid rgba(226,174,73,.4);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.9);
  overflow: hidden;
  animation: modal-in .3s cubic-bezier(.2,.9,.3,1.1) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(226,174,73,.25);
}
.modal-head h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .03em;
  color: var(--gold-hi);
}
.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(226,174,73,.35);
  background: transparent;
  color: var(--cream-dim);
  font-size: 1rem;
  transition: color .2s, border-color .2s;
}
.modal-close:hover { color: var(--ruby-hi); border-color: var(--ruby); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(226,174,73,.25);
}

/* busca de cartas */
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row select, .search-row input[type="text"] {
  font-family: inherit;
  font-size: .98rem;
  color: var(--cream);
  background: rgba(12,18,34,.7);
  border: 1px solid rgba(226,174,73,.35);
  border-radius: 9px;
  padding: 11px 13px;
  transition: border-color .2s;
}
.search-row select:focus, .search-row input:focus { outline: none; border-color: var(--gold); }
.search-row select { flex: 0 0 auto; }
.search-row input[type="text"] { flex: 1; min-width: 160px; }

.search-hint { font-size: .82rem; color: var(--muted); margin-top: 10px; }
.search-status { margin: 16px 0 4px; font-size: .9rem; color: var(--cream-dim); min-height: 1.3em; }
.search-status.error { color: var(--ruby-hi); }

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.result-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(12,18,34,.55);
  border: 1px solid rgba(226,174,73,.2);
  animation: rise-in .35s ease both;
}
.result-card img {
  width: 100%;
  aspect-ratio: 63/88;
  object-fit: cover;
  border-radius: 6px;
  background: var(--navy);
}
.result-card .no-img {
  width: 100%;
  aspect-ratio: 63/88;
  border-radius: 6px;
  border: 2px dashed rgba(226,174,73,.4);
  background:
    radial-gradient(90% 70% at 50% 25%, rgba(44,66,118,.5), transparent 70%),
    var(--night-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  text-align: center;
}
.result-card .no-img b {
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--gold-hi);
  line-height: 1.2;
}
.result-card .no-img i {
  font-style: normal;
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.result-card .r-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}
.result-card .r-set { font-size: .72rem; color: var(--muted); }

.spinner {
  width: 34px; height: 34px;
  margin: 24px auto;
  border-radius: 50%;
  border: 3px solid rgba(226,174,73,.25);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* modal de recorte */
.crop-area {
  width: 100%;
  height: min(56vh, 520px);
  background: #0a0f1d;
  border-radius: 8px;
  overflow: hidden;
}
.crop-area img { max-width: 100%; display: block; }
.crop-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* cropper.js — tema */
.cropper-view-box { outline: 2px solid var(--gold); outline-offset: -1px; }
.cropper-line, .cropper-point { background-color: var(--gold); }
.cropper-point { width: 8px; height: 8px; }

/* modal PDF / progresso */
.progress-box { text-align: center; padding: 10px 6px 4px; }
.progress-box .bar {
  height: 10px;
  border-radius: 99px;
  background: rgba(12,18,34,.8);
  border: 1px solid rgba(226,174,73,.3);
  overflow: hidden;
  margin: 16px 0 10px;
}
.progress-box .bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi), var(--flame));
  background-size: 200% 100%;
  animation: badge-shimmer 1.6s linear infinite;
  transition: width .3s ease;
}
.progress-box p { color: var(--cream-dim); font-size: .92rem; }

/* confirmação */
.confirm-text { color: var(--cream-dim); line-height: 1.55; }
.confirm-text b { color: var(--cream); }

/* ============================================================
   ARTES PREMIUM
   ============================================================ */
.own-art-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(226,174,73,.35);
  background: rgba(34,51,94,.5);
  color: var(--cream);
  font-size: .98rem;
  transition: border-color .2s, background .2s;
}
.own-art-btn:hover { border-color: var(--gold); background: rgba(44,66,118,.6); }
.own-art-btn .oa-icon { font-size: 1.7rem; }
.own-art-btn small { color: var(--muted); }

.premium-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--gold-hi);
  margin: 20px 0 6px;
}
.premium-note { font-size: .85rem; color: var(--muted); line-height: 1.5; }

.premium-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.premium-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
  border-radius: 10px;
  background: rgba(12,18,34,.55);
  border: 1px solid rgba(226,174,73,.3);
  animation: rise-in .35s ease both;
}
.premium-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 6px;
}
.premium-item .p-name { font-weight: 800; font-size: .92rem; color: var(--cream); }
.premium-item .p-desc { font-size: .75rem; color: var(--muted); line-height: 1.4; flex: 1; }
.premium-item .p-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-hi);
  font-size: 1.05rem;
}

/* selo ✦ nos bolsos com arte premium */
.pocket .premium-mark {
  position: absolute;
  top: 5px; right: 6px;
  z-index: 2;
  font-size: .8rem;
  color: var(--gold-hi);
  text-shadow: 0 0 8px rgba(226,174,73,.9);
  pointer-events: none;
  animation: t-spark-still 2.6s ease infinite;
}
@keyframes t-spark-still {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

/* ============================================================
   CONTA / LOGIN
   ============================================================ */
#btnAccount.logged {
  color: var(--gold-hi);
  border-color: var(--gold);
  background: rgba(226,174,73,.14);
}
.login-lead {
  margin: 0 0 16px;
  color: var(--cream-dim);
  line-height: 1.6;
  font-size: .95rem;
}
.login-form { display: flex; gap: 10px; flex-wrap: wrap; }
.login-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--cream);
  background: rgba(12,18,34,.75);
  border: 1px solid rgba(226,174,73,.35);
}
.login-form input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(226,174,73,.18);
}
.login-msg { margin: 14px 0 0; font-size: .92rem; line-height: 1.55; }
.login-msg.error { color: #ff8ba1; }
.login-msg.ok { color: var(--ok); }
.login-fine { margin: 16px 0 0; font-size: .78rem; color: var(--muted); line-height: 1.5; }
.login-fine a, .acc-danger a { color: var(--gold-hi); }

/* painel "Minha conta" */
.acc-email { margin: 0 0 4px; color: var(--cream-dim); }
.acc-email b { color: var(--gold-hi); }
.acc-stats { margin: 0 0 18px; font-size: .86rem; color: var(--muted); }
.acc-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.acc-actions .btn { flex: 1 1 auto; text-align: center; text-decoration: none; }
.acc-danger {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 11px;
  border: 1px solid rgba(217,46,90,.35);
  background: rgba(217,46,90,.07);
}
.acc-danger h4 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #ff8ba1;
}
.acc-danger p { margin: 0 0 12px; font-size: .84rem; line-height: 1.5; color: var(--cream-dim); }
.acc-danger .btn { width: 100%; }

/* selo de preço (mypcards) nos bolsos, no modo "Ver preços" */
.pocket .price-badge {
  position: absolute;
  left: 5px; bottom: 5px;
  z-index: 3;
  max-width: calc(100% - 10px);
  padding: 3px 7px;
  border-radius: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .74rem;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(226,174,73,.45);
  background: rgba(12,18,34,.82);
  color: var(--gold-hi);
  backdrop-filter: blur(2px);
  box-shadow: 0 3px 10px -4px rgba(0,0,0,.7);
}
.pocket .price-badge.ok { cursor: pointer; }
.pocket .price-badge.ok:hover { border-color: var(--gold); filter: brightness(1.12); }
/* oferta da própria VilaTCG: destaque em rubi com brilho */
.pocket .price-badge.store {
  cursor: pointer;
  color: #fff;
  border-color: var(--ruby-hi);
  background: linear-gradient(160deg, rgba(217,46,90,.95) 0%, rgba(156,28,62,.95) 100%);
  box-shadow: 0 0 10px -2px rgba(217,46,90,.7), 0 3px 10px -4px rgba(0,0,0,.7);
}
.pocket .price-badge.store:hover { filter: brightness(1.12); }
.pocket .price-badge.loading { color: var(--muted); border-color: rgba(226,174,73,.2); }
.pocket .price-badge.na {
  color: var(--muted);
  border-color: rgba(226,174,73,.18);
  background: rgba(12,18,34,.7);
}

#btnPrices.active {
  color: var(--gold-hi);
  border-color: var(--gold);
  background: rgba(226,174,73,.14);
}
#statValue { color: var(--gold-hi); }
#statValue b { font-family: var(--font-display); }

.pay-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid rgba(226,174,73,.4);
  background: rgba(226,174,73,.08);
  color: var(--gold-hi) !important;
  animation: pay-pulse 1.6s ease infinite;
}
@keyframes pay-pulse { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* fatura no modal de pagamento */
.premium-bill { display: flex; flex-direction: column; gap: 8px; }
.premium-bill .bill-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 9px;
  background: rgba(12,18,34,.55);
  border: 1px solid rgba(226,174,73,.25);
}
.premium-bill .bill-row img { width: 40px; height: 54px; object-fit: cover; border-radius: 4px; }
.premium-bill .bill-row b { flex: 1; font-size: .95rem; color: var(--cream); }
.premium-bill .bill-row span { font-weight: 800; color: var(--gold-hi); white-space: nowrap; }
.premium-total {
  text-align: right;
  margin-top: 12px;
  color: var(--cream-dim);
}
.premium-total b {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold-hi);
  margin-left: 6px;
}

/* ============================================================
   TUTORIAL ANIMADO
   ============================================================ */
.tut-modal { width: min(500px, 100%); }
.tut-body { text-align: center; }

.tut-scenes {
  position: relative;
  height: 190px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(44,66,118,.45), transparent 70%),
    rgba(12,18,34,.6);
  border: 1px solid rgba(226,174,73,.2);
  overflow: hidden;
  margin-bottom: 16px;
}
.tut-scene { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }

.tut-step-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: .03em;
  color: var(--gold-hi);
  margin-bottom: 8px;
}
.tut-step-desc {
  color: var(--cream-dim);
  line-height: 1.55;
  font-size: .97rem;
  max-width: 42ch;
  margin: 0 auto;
  min-height: 4.6em;
}

.tut-foot { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.tut-dots { display: flex; gap: 8px; }
.tut-dots button {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(226,174,73,.5);
  background: transparent;
  padding: 0;
  transition: background .2s, transform .2s;
}
.tut-dots button.on { background: var(--gold); transform: scale(1.25); }
.tut-nav { display: flex; gap: 8px; }

/* --- cena 1: formatos --- */
.sc-formats .t-grid { display: grid; grid-template-columns: repeat(3, 36px); gap: 7px; }
.sc-formats .t-grid i {
  aspect-ratio: 63/88;
  border-radius: 4px;
  border: 1.5px solid var(--gold);
  background: linear-gradient(160deg, var(--plate-hi), var(--navy));
  animation: t-pop 4s ease infinite both;
}
.sc-formats .t-grid i:nth-child(2) { animation-delay: .12s; }
.sc-formats .t-grid i:nth-child(3) { animation-delay: .24s; }
.sc-formats .t-grid i:nth-child(4) { animation-delay: .36s; }
.sc-formats .t-grid i:nth-child(5) { animation-delay: .48s; }
.sc-formats .t-grid i:nth-child(6) { animation-delay: .6s; }
.sc-formats .t-grid i:nth-child(7) { animation-delay: .72s; }
.sc-formats .t-grid i:nth-child(8) { animation-delay: .84s; }
.sc-formats .t-grid i:nth-child(9) { animation-delay: .96s; }
@keyframes t-pop {
  0% { opacity: 0; transform: scale(0); }
  10% { opacity: 1; transform: scale(1.18); }
  16%, 82% { opacity: 1; transform: scale(1); }
  95%, 100% { opacity: 0; transform: scale(.6); }
}

/* --- cena 2: carta entra no bolso --- */
.sc-card .t-pocket {
  width: 86px;
  aspect-ratio: 63/88;
  border: 2px dashed rgba(226,174,73,.55);
  border-radius: 8px;
  display: grid;
  place-items: center;
  animation: t-pocket-glow 3.2s ease infinite;
}
@keyframes t-pocket-glow {
  0%, 40% { border-color: rgba(226,174,73,.55); box-shadow: none; }
  55%, 85% { border-color: var(--gold-hi); box-shadow: 0 0 22px -4px rgba(226,174,73,.7); }
  100% { border-color: rgba(226,174,73,.55); }
}
.sc-card .t-card {
  width: 74px;
  aspect-ratio: 63/88;
  border-radius: 6px;
  background: linear-gradient(165deg, var(--gold-hi) 0%, var(--gold) 45%, #b97f2e 100%);
  display: grid;
  place-items: center;
  animation: t-drop 3.2s cubic-bezier(.3,.9,.3,1.15) infinite;
}
.sc-card .t-card b {
  width: 30px; height: 30px;
  border-radius: 50%;
  background:
    linear-gradient(180deg, var(--ruby) 0%, var(--ruby) 46%, #1a1a1a 46%, #1a1a1a 54%, #fff 54%, #fff 100%);
  border: 2.5px solid #1a1a1a;
  position: relative;
}
.sc-card .t-card b::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 9px; height: 9px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #1a1a1a;
}
@keyframes t-drop {
  0%, 12% { opacity: 0; transform: translateY(-110px) rotate(-10deg); }
  50% { opacity: 1; transform: translateY(0) rotate(0); }
  86% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0) scale(.9); }
}
.t-spark {
  position: absolute;
  color: var(--gold-hi);
  font-size: 1rem;
  opacity: 0;
  animation: t-spark 3.2s ease infinite;
}
.t-spark.s1 { left: 32%; top: 30%; animation-delay: 1.5s; }
.t-spark.s2 { right: 31%; top: 55%; animation-delay: 1.75s; font-size: .75rem; }
.t-spark.s3 { left: 36%; bottom: 22%; animation-delay: 2s; font-size: .8rem; }
@keyframes t-spark {
  0%, 40% { opacity: 0; transform: scale(.4) rotate(0); }
  55% { opacity: 1; transform: scale(1.2) rotate(40deg); }
  75%, 100% { opacity: 0; transform: scale(.5) rotate(80deg); }
}

/* --- cena 3: recorte de imagem --- */
.sc-crop .t-photo {
  position: relative;
  width: 180px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(28px 28px at 76% 22%, #f8dd8c 0 45%, transparent 50%),
    linear-gradient(180deg, #6fb6d8 0%, #8ec9e2 52%, #3f7d5a 52%, #2c5e46 100%);
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.6);
}
.sc-crop .t-photo::before {
  content: "";
  position: absolute;
  left: 8%; bottom: 38%;
  border-left: 34px solid transparent;
  border-right: 34px solid transparent;
  border-bottom: 46px solid #274a68;
}
.sc-crop .t-photo::after {
  content: "";
  position: absolute;
  left: 34%; bottom: 40%;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-bottom: 34px solid #35608a;
}
.sc-crop .t-frame {
  position: absolute;
  width: 62px;
  aspect-ratio: 63/88;
  border: 2.5px dashed var(--gold-hi);
  border-radius: 4px;
  box-shadow: 0 0 0 400px rgba(6,10,20,.55);
  animation: t-frame 4.2s ease-in-out infinite;
}
@keyframes t-frame {
  0%, 12% { transform: translate(-42px, -6px) scale(.9); }
  38%, 58% { transform: translate(28px, 4px) scale(1.06); }
  84%, 100% { transform: translate(-6px, 0) scale(1); }
}

/* --- cena 4: arte dividida --- */
.sc-art .t-art {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 0px;
}
.sc-art .t-art i {
  aspect-ratio: 63/88;
  background:
    radial-gradient(60% 45% at 62% 38%, rgba(248,221,140,.85), transparent 60%),
    linear-gradient(140deg, #7fd4e8 0%, #3a6fb0 45%, #d92e5a 80%, #f2892d 100%);
  background-size: 300% 300%;
  border-radius: 2px;
  animation: t-split 4.4s ease-in-out infinite;
}
.sc-art .t-art i:nth-child(1) { background-position: 0% 0%; }
.sc-art .t-art i:nth-child(2) { background-position: 50% 0%; }
.sc-art .t-art i:nth-child(3) { background-position: 100% 0%; }
.sc-art .t-art i:nth-child(4) { background-position: 0% 50%; }
.sc-art .t-art i:nth-child(5) { background-position: 50% 50%; }
.sc-art .t-art i:nth-child(6) { background-position: 100% 50%; }
.sc-art .t-art i:nth-child(7) { background-position: 0% 100%; }
.sc-art .t-art i:nth-child(8) { background-position: 50% 100%; }
.sc-art .t-art i:nth-child(9) { background-position: 100% 100%; }
@keyframes t-split {
  0%, 22% { transform: scale(1); border-radius: 0; box-shadow: none; }
  48%, 78% { transform: scale(.88); border-radius: 4px; box-shadow: 0 4px 12px -3px rgba(0,0,0,.6), 0 0 0 1.5px var(--gold); }
  100% { transform: scale(1); border-radius: 0; }
}

/* --- cena 5: PDF --- */
.sc-pdf .t-sheet {
  width: 120px;
  padding: 12px 10px;
  border-radius: 6px;
  background: #f2efe6;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,.7);
  animation: t-sheet 3.4s ease infinite;
}
.sc-pdf .t-sheet i {
  aspect-ratio: 63/88;
  border-radius: 2px;
  background: linear-gradient(160deg, var(--plate-hi), var(--navy));
  outline: 1px dashed #b9b2a0;
  outline-offset: 1.5px;
}
@keyframes t-sheet {
  0%, 55% { transform: translateY(0); }
  70% { transform: translateY(5px); }
  85%, 100% { transform: translateY(0); }
}
.sc-pdf .t-arrow {
  position: absolute;
  right: 26%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  color: var(--gold-hi);
  text-shadow: 0 4px 14px rgba(226,174,73,.5);
  animation: t-arrow 1.7s ease infinite;
}
@keyframes t-arrow {
  0%, 100% { transform: translateY(-58%); opacity: .75; }
  50% { transform: translateY(-42%); opacity: 1; }
}

/* ---------- toast ---------- */
.toast-zone {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  padding: 11px 20px;
  border-radius: 99px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--cream);
  background: linear-gradient(180deg, #22335e 0%, #1a2747 100%);
  border: 1px solid rgba(226,174,73,.5);
  box-shadow: 0 12px 30px -8px rgba(0,0,0,.8);
  animation: toast-in .3s cubic-bezier(.2,.9,.3,1.2) both;
}
.toast.err { border-color: var(--ruby); color: #ffc9d4; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(.92); }
  to   { opacity: 1; transform: none; }
}
.toast.bye { animation: toast-out .3s ease both; }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- responsivo ---------- */
@media (max-width: 640px) {
  .editor-head { flex-direction: column; align-items: stretch; }
  .editor-actions { justify-content: stretch; }
  .editor-actions .btn { flex: 1; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 94vh; border-radius: 16px 16px 0 0; width: 100%; }
  .saved-item { flex-wrap: wrap; }
  .pocket-menu { gap: 5px; padding: 7%; }
}

@media (prefers-reduced-motion: reduce) {
  .pockets, .pocket img.slot-img, .modal, .toast { animation: none !important; }
}
