/**
 * assets/css/guardioes.css - DECLARAR EXU E POMBAGIRA
 *
 * Mesmo padrao visual de carta.css (.pc-*): painel proprio sobre overlay,
 * Cinzel so no peso 400 (negrito via -webkit-text-stroke), dourado do
 * --gold/--gold-light. z-index acima do .pc-overlay para poder ser aberto
 * de dentro do fim do ritual de buzios sem fechar a carta.
 *
 * ARMADILHA: o envoltorio de uma grade interna tem de ser display:block -
 * um wrapper display:grid em volta de .pg-grid colapsa a grade numa coluna.
 */

.pg-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(4, 4, 7, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  animation: pgEntra 0.22s ease;
  display: block;
}

@keyframes pgEntra {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pg-painel {
  position: relative;
  width: min(760px, 94vw);
  margin: 28px auto 56px;
  padding: 30px clamp(16px, 3vw, 40px) 40px;
  border-radius: 20px;
  background: linear-gradient(170deg, rgba(28, 24, 33, 0.97), rgba(13, 12, 17, 0.985));
  border: 1px solid rgba(212, 175, 55, 0.38);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  outline: none;
  display: block;
}

.pg-fechar {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary, #F4F1E8);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pg-fechar:hover { background: rgba(212, 175, 55, 0.18); }

.pg-voltar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gold-light, #F3DD8B);
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 10px;
  padding: 0;
}
.pg-voltar:hover { text-decoration: underline; }

.pg-titulo {
  font-family: var(--font-display, 'Cinzel'), Georgia, serif;
  font-weight: 400;
  font-synthesis: none;
  -webkit-text-stroke: 0.8px currentColor;
  paint-order: stroke fill;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #EBCE6E;
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
  margin: 6px 0 10px;
  padding-right: 40px;
}

.pg-lead {
  font-family: var(--font-serif, 'Cormorant Garamond'), Georgia, serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted, #A9A6B0);
  margin: 0 0 20px;
}

.pg-lead--aviso {
  color: var(--text-primary, #F4F1E8);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  padding: 14px 16px;
}

/* --------------------------------------------------------------- abas */

.pg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.pg-tab {
  background: none;
  border: none;
  color: var(--text-muted, #A9A6B0);
  font-family: var(--font-display, 'Cinzel'), Georgia, serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.pg-tab.active {
  color: #EBCE6E;
  border-bottom-color: var(--gold, #D4AF37);
}

.pg-conteudo { display: block; }

/* ------------------------------------------------------------ cartões */

.pg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 0 0 18px;
}

.pg-grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.pg-card {
  border-radius: 14px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pg-card--jogo { border-color: rgba(63, 191, 127, 0.35); }
.pg-card--declarado { border-color: rgba(212, 175, 55, 0.35); }

.pg-card__origem {
  display: inline-block;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  width: fit-content;
}
.pg-card__origem.is-jogo {
  background: rgba(63, 191, 127, 0.14);
  color: var(--green-ok, #3FBF7F);
}
.pg-card__origem.is-declarado {
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-light, #F3DD8B);
}

.pg-card__nome {
  font-family: var(--font-display, 'Cinzel'), Georgia, serif;
  font-weight: 400;
  font-synthesis: none;
  -webkit-text-stroke: 0.4px currentColor;
  paint-order: stroke fill;
  font-size: 18px;
  color: var(--text-primary, #F4F1E8);
  margin: 2px 0 0;
}

.pg-card__meta {
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 12px;
  color: var(--text-muted, #A9A6B0);
  margin: 0;
}

.pg-card__lema {
  font-family: var(--font-serif, 'Cormorant Garamond'), Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--gold-light, #F3DD8B);
  margin: 0;
}

.pg-card__linhas {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 12.5px;
}
.pg-card__linhas dt { color: var(--text-muted, #A9A6B0); }
.pg-card__linhas dd { margin: 0; color: var(--text-primary, #F4F1E8); }

.pg-card__acoes {
  display: flex;
  gap: 14px;
  margin-top: 10px;
}

.pg-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 12.5px;
  color: var(--gold-light, #F3DD8B);
  cursor: pointer;
}
.pg-link:hover { text-decoration: underline; }
.pg-link--sair { color: var(--crimson, #B3122A); }
.pg-link:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: none; }

.pg-vazio {
  font-family: var(--font-serif, 'Cormorant Garamond'), Georgia, serif;
  font-style: italic;
  color: var(--text-muted, #A9A6B0);
  grid-column: 1 / -1;
}

.pg-limite {
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 12.5px;
  color: var(--text-muted, #A9A6B0);
}

.pg-btn-declarar { width: 100%; }

/* ------------------------------------------------------------ catálogo */

.pg-filtros {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pg-filtros select {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text-primary, #F4F1E8);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 13px;
}

.pg-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pg-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.5);
}
.pg-tile__carta svg { width: 100%; height: auto; display: block; }
.pg-tile__nome {
  font-family: var(--font-display, 'Cinzel'), Georgia, serif;
  font-weight: 400;
  font-synthesis: none;
  -webkit-text-stroke: 0.3px currentColor;
  paint-order: stroke fill;
  font-size: 13px;
  color: var(--text-primary, #F4F1E8);
}
.pg-tile__resumo {
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 11px;
  color: var(--text-muted, #A9A6B0);
}

.pg-paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 12.5px;
  color: var(--text-muted, #A9A6B0);
  flex-wrap: wrap;
}
.pg-paginacao button:disabled { opacity: 0.3; cursor: not-allowed; }

/* ---------------------------------------------------------------- form */

.pg-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.pg-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 13px;
  color: var(--text-muted, #A9A6B0);
}
.pg-form input,
.pg-form textarea {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text-primary, #F4F1E8);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 14px;
  resize: vertical;
}
.pg-form input:focus,
.pg-form textarea:focus {
  outline: none;
  border-color: var(--gold, #D4AF37);
}

.pg-form__erro {
  color: var(--crimson, #B3122A);
  font-family: var(--font-sans, 'Inter'), sans-serif;
  font-size: 13px;
  margin: 0;
}

/* ------------------------------------------------------------ estados */

.pg-carregando,
.pg-erro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 10px;
  text-align: center;
  font-family: var(--font-serif, 'Cormorant Garamond'), Georgia, serif;
  color: var(--text-muted, #A9A6B0);
}

.pg-aro {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold, #D4AF37);
  animation: pgGira 0.9s linear infinite;
}

@keyframes pgGira {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .pg-painel { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; padding: 24px 14px 40px; }
  .pg-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .pg-overlay { animation: none; }
  .pg-aro { animation: none; border-top-color: rgba(212, 175, 55, 0.2); }
  .pg-tile { transition: none; }
  .pg-tile:hover { transform: none; }
}
