/* Reproduz o pop-up "POP-UP DO PLACAR" do Figma (frame 1485-6640).
   Mesma paleta/medidas de base do pop-up da Classificacao
   (modulos/classificacao-modal/classificacao-modal.css) — o que é NOVO deste
   pop-up (grade de fotos, upload, oferecimento) está marcado com "(nosso)"
   onde o valor não vem do Figma. */

.pm-fundo,
.pm-janela,
.pm-arte,
.pm-painel,
.pm-cabecalho,
.pm-titulo,
.pm-fechar,
.pm-grupo,
.pm-rotulo,
.pm-fotos,
.pm-foto-item,
.pm-aviso-fotos,
.pm-linha-upload,
.pm-upload,
.pm-select,
.pm-credito,
.pm-legenda,
.pm-linha-legenda,
.pm-contador,
.pm-aviso,
.pm-acoes,
.pm-editar,
.pm-baixar,
.pm-pulso,
.pm-esq-titulo,
.pm-esq-rotulo,
.pm-esq-fotos,
.pm-esq-select,
.pm-esq-credito,
.pm-esq-legenda,
.pm-esq-botao {
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}

.pm-fundo {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
}

.pm-janela {
  display: flex;
  gap: 28px;
  padding: 28px;
  background: #171a21;
  border: 1px solid #2a2e38;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  color: #e6e8ec;
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}

.pm-arte {
  position: relative;
  flex: none;
  width: 520px;
  height: 650px;
  background: #22262e;
  overflow: hidden;
}

.pm-arte img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* (nosso) preview ao vivo com a foto arrastavel — ver modelo.js
   (geometriaDeFundo/estiloDaFoto) e vista.js (renderizarArte). A camada da
   foto cobre o palco inteiro e recebe o drag; o overlay (grafismo
   transparente da Templated) fica por cima, sem pointer-events, pra nunca
   atrapalhar o arrasto. */
.pm-arte-foto {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
}

.pm-arte-foto--arrastavel {
  cursor: grab;
}

.pm-arte-foto--arrastavel.pm-arte-foto--arrastando {
  cursor: grabbing;
}

.pm-arte-foto-img {
  position: absolute;
  display: block;
  /* width/height/left/top de verdade vem inline (ver estiloDaFoto) — isto
     aqui e so o fallback antes da geometria ser calculada (onload). */
  user-select: none;
  -webkit-user-drag: none;
}

.pm-arte-foto-img--cover-css {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  object-fit: cover;
}

.pm-arte-overlay {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* (nosso) cartao novo (DOM/CSS, ver apps/web/modulos/placar-cartao/) atras
   da flag placar_cartao_dom — substitui .pm-arte-overlay/.pm-arte-foto
   quando a previa manda `cartao` (ver modelo.js/vista.js). O palco nativo
   (.pc-palco, dentro de .pm-arte-cartao-interno) e sempre 1080x1350; quem
   escala pra caber na caixa visivel (fixa 520x650 acima de 1100px, fluida
   abaixo — ver @media no fim deste arquivo) e o JS (vista.js:escalarCartao),
   nunca um numero fixo aqui, porque essa caixa muda de tamanho. */
.pm-arte-cartao {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.pm-arte-cartao-interno {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1350px;
  transform-origin: top left;
}

/* Foto por baixo do cartao DOM — mesma logica de arrasto/zoom de
   .pm-arte-foto-img (width/height/left/top de verdade vem inline de
   M.estiloDaFoto), so que dentro do palco nativo 1080x1350 em vez do palco
   ja escalado pra tela. */
.pm-arte-cartao-foto {
  position: absolute;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.pm-arte-cartao-foto--cover-css {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  object-fit: cover;
}

/* Arrasto/cursor do cartao reusa as MESMAS classes de .pm-arte-foto (ver
   aoPonteiroBaixo/Soltar em placar-modal.js) — nao ha diferenca de estilo
   entre arrastar a foto por baixo do overlay antigo ou por baixo do cartao
   novo, so o elemento-alvo muda. */

/* (nosso) rodinha girando sobre o preview enquanto a arte carrega — ver
   vista.js (spinner.hidden) e modelo.js (avisoDaFase, sem texto nesta fase). */
.pm-arte-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 4px solid rgba(230, 232, 236, 0.25);
  border-top-color: #e6e8ec;
  animation: pm-girar 0.8s linear infinite;
  pointer-events: none;
}

@keyframes pm-girar {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pm-arte-spinner {
    animation: none;
  }
}

.pm-painel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 420px;
  height: 650px;
  flex: none;
  overflow-y: auto;
}

.pm-cabecalho {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pm-titulo {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #e6e8ec;
}

.pm-fechar {
  background: none;
  border: 0;
  padding: 0;
  color: #9aa1ac;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.pm-fechar:hover {
  color: #e6e8ec;
}

.pm-grupo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-rotulo {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.96px;
  text-transform: uppercase;
  color: #9aa1ac;
}

/* (nosso) grade de fotos: Getty/AGIF + a do upload na frente, quando houver */
.pm-fotos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.pm-foto-item {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 2px solid #2a2e38;
  border-radius: 6px;
  background: #1e2129;
  overflow: hidden;
  cursor: pointer;
}

.pm-foto-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pm-foto-carregando {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #9aa1ac;
  font-size: 12px;
}

.pm-foto-item[aria-pressed="true"] {
  border-color: #4f8cff;
}

.pm-foto-item:disabled {
  cursor: default;
  opacity: 0.6;
}

.pm-aviso-fotos {
  font-size: 12px;
  color: #9aa1ac;
}

.pm-aviso-fotos[hidden] {
  display: none;
}

.pm-linha-upload {
  display: flex;
  gap: 8px;
}

.pm-upload {
  flex: 1 1 0;
  padding: 8px 0;
  border: 1px solid #2a2e38;
  border-radius: 6px;
  background: #1e2129;
  color: #e6e8ec;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.pm-upload:hover {
  border-color: #4f8cff;
}

.pm-upload:disabled {
  cursor: default;
  opacity: 0.6;
}

/* (nosso) select do oferecimento — mesma casca visual do botao de recorte */
.pm-select {
  width: 100%;
  padding: 10px 12px;
  background: #1e2129;
  border: 1px solid #2a2e38;
  border-radius: 8px;
  color: #e6e8ec;
  font: inherit;
  font-size: 14px;
}

.pm-select:disabled {
  opacity: 0.6;
}

/* (nosso) credito da foto (2026-10-27) — input de uma linha, mesma casca
   visual da legenda/select, acima da legenda no formulario */
.pm-credito {
  width: 100%;
  padding: 10px 12px;
  background: #1e2129;
  border: 1px solid #2a2e38;
  border-radius: 8px;
  color: #e6e8ec;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.pm-credito:focus {
  border-color: #4f8cff;
}

.pm-credito:disabled {
  opacity: 0.6;
}

.pm-legenda {
  flex: 1 1 auto;
  min-height: 100px;
  width: 100%;
  padding: 14px;
  background: #1e2129;
  border: 1px solid #2a2e38;
  border-radius: 8px;
  color: #e6e8ec;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.pm-legenda:focus {
  border-color: #4f8cff;
}

.pm-legenda:disabled {
  opacity: 0.6;
}

.pm-linha-legenda {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pm-contador {
  font-size: 12px;
  color: #9aa1ac;
}

.pm-contador.excedido {
  color: #ff6b6b;
}

.pm-aviso {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #ffb4b4;
  background: rgba(227, 38, 46, 0.12);
  border: 1px solid rgba(227, 38, 46, 0.4);
}

.pm-aviso[hidden] {
  display: none;
}

.pm-aviso.ok {
  color: #b4f0cf;
  background: rgba(110, 231, 168, 0.12);
  border-color: rgba(110, 231, 168, 0.4);
}

/* (nosso) Editar + Publicar lado a lado — o Figma so tem Publicar; Editar e o
   gatilho que falta pra re-renderizar a arte quando a foto/oferecimento muda
   (ver o comentario no topo de modelo.js). */
.pm-acoes {
  display: flex;
  gap: 8px;
}

.pm-editar {
  flex: 1 1 0;
  padding: 12px 0;
  border: 1px solid #2a2e38;
  border-radius: 8px;
  background: transparent;
  color: #e6e8ec;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.pm-editar:hover {
  border-color: #4f8cff;
}

.pm-editar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pm-baixar {
  flex: 2 1 0;
  padding: 12px 0;
  border: 0;
  border-radius: 8px;
  background: #4f8cff;
  color: #0e0e0e;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  line-height: 18px;
}

.pm-baixar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Esqueleto de carregamento */
.pm-pulso {
  background: #22262e;
  animation: pm-pulso 1.2s ease-in-out infinite; /* (nosso) duração */
}

@keyframes pm-pulso {
  0%,
  100% {
    background-color: #22262e;
  }
  50% {
    background-color: #282c35;
  }
}

.pm-esq-titulo {
  width: 250px;
  height: 24px;
  border-radius: 6px;
}

.pm-esq-rotulo {
  width: 70px;
  height: 10px;
  border-radius: 6px;
}

.pm-esq-fotos {
  height: 110px;
  width: 100%;
  border-radius: 6px;
}

.pm-esq-select {
  height: 38px;
  width: 100%;
  border-radius: 6px;
}

.pm-esq-credito {
  height: 38px;
  width: 100%;
  border-radius: 6px;
}

.pm-esq-legenda {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border-radius: 6px;
}

.pm-esq-botao {
  height: 46px;
  width: 100%;
  border-radius: 8px;
  background: #282c35;
}

@media (prefers-reduced-motion: reduce) {
  .pm-pulso {
    animation: none;
  }
}

@media (max-width: 1100px) {
  .pm-janela {
    flex-direction: column;
  }

  .pm-arte {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
  }

  .pm-painel {
    width: 100%;
    height: auto;
  }

  .pm-legenda {
    min-height: 160px;
  }
}

/* O atributo hidden perde para display:flex das classes do modal; esta regra o faz valer. */
.pm-fundo [hidden] { display: none !important; }
