/* =============================================================================
   BRAWL HUB — Componentes reutilizáveis
   Fase 1 · Botões, cards, etiquetas, progresso, campos e tiles de estatística.
   Estilo inspirado em interface de jogo: contornos fortes, sombra inferior
   e efeito de pressão ao clicar.
   ========================================================================== */

/* ============================== BOTÕES ================================== */
.btn {
  --btn-bg: var(--yellow);
  --btn-shadow: var(--shadow-btn);
  --btn-fg: var(--on-yellow);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.5rem;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 3px solid rgba(0, 0, 0, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--btn-shadow), var(--shadow-inset);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.06);
}

/* Efeito de pressão: o botão "afunda" ao ser clicado */
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--btn-shadow-color, var(--yellow-shadow)), var(--shadow-inset);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn--sm {
  padding: 0.45rem 1rem;
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
}

.btn--lg {
  padding: 0.95rem 2rem;
  font-size: var(--fs-md);
}

.btn--block {
  width: 100%;
}

/* Variantes */
.btn--sky {
  --btn-bg: var(--sky);
  --btn-shadow: var(--shadow-btn-sky);
  --btn-fg: #04202c;
}

.btn--purple {
  --btn-bg: var(--purple);
  --btn-shadow: var(--shadow-btn-purple);
  --btn-fg: #ffffff;
}

.btn--ghost {
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-shadow: var(--shadow-btn-ghost);
  --btn-fg: var(--text);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn__icon {
  width: 1.05em;
  height: 1.05em;
  flex: none;
}

/* ============================== CARDS =================================== */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-500) 0%, var(--surface-600) 100%);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-inset);
  padding: var(--sp-5);
}

.card--flat {
  box-shadow: none;
  background: var(--bg-700);
}

/* Barra de destaque no topo do card — comunica categoria por cor */
.card--accent { border-top: 6px solid var(--yellow); }
.card--accent-sky { border-top: 6px solid var(--sky); }
.card--accent-purple { border-top: 6px solid var(--purple); }
.card--accent-green { border-top: 6px solid var(--green); }

.card__title {
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-2);
}

.card__text {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ======================== METADADOS TEMÁTICOS ============================
   Metadados continuam reutilizáveis, mas não são mais cápsulas decorativas.
   A hierarquia vem da tipografia, cor e pequenos acentos — mais próxima de
   uma interface de jogo e menos de um dashboard corporativo. */
.meta-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  text-transform: none;
  background: none;
  border: 0;
  line-height: 1.5;
}

.meta-label--yellow { color: var(--yellow); }
.meta-label--sky    { color: var(--sky); }
.meta-label--purple { color: var(--purple); }
.meta-label--green  { color: var(--green); }
.meta-label--red    { color: var(--red); }
.meta-label--orange { color: var(--orange); }
.meta-label--muted  { color: var(--text-muted); }

/* Kicker de seção: destaque tipográfico, sem cápsula ou caixa alta forçada. */
.section-head > .meta-label,
.hero__eyebrow > .meta-label {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
}

/* ========================= PÍLULA DE TROFÉUS ============================ */
.trophy-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  color: var(--yellow);
  letter-spacing: 0.02em;
}

.trophy-pill svg {
  width: 1.1em;
  height: 1.1em;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

/* =========================== BARRA DE PROGRESSO ========================= */
.progress {
  --p: 0%;
  --progress-fill: linear-gradient(90deg, var(--sky) 0%, var(--sky-deep) 100%);

  position: relative;
  width: 100%;
  height: 14px;
  background: var(--bg-900);
  border: 2px solid rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-pill);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.progress__fill {
  height: 100%;
  width: var(--p);
  background: var(--progress-fill);
  border-radius: var(--radius-pill);
  animation: progress-grow 1.1s var(--ease-pop);
  transition: width 0.4s var(--ease-pop);
}

.progress--yellow { --progress-fill: linear-gradient(90deg, var(--yellow-bright), var(--yellow-deep)); }
.progress--green  { --progress-fill: linear-gradient(90deg, var(--green), var(--green-deep)); }
.progress--purple { --progress-fill: linear-gradient(90deg, var(--purple), var(--purple-deep)); }

@keyframes progress-grow {
  from { width: 0; }
  to { width: var(--p); }
}

/* ============================== CAMPOS ================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field__label {
  font-weight: 800;
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 0.8rem 1.1rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-md);
  color: var(--text);
  background: var(--bg-900);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

.input:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(62, 200, 240, 0.22);
}

.input--tag {
  font-family: var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ====================== TILE DE ESTATÍSTICA ============================= */
.stat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(180deg, var(--surface-500) 0%, var(--surface-600) 100%);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card), var(--shadow-inset);
  transition: transform 0.16s var(--ease-pop), border-color 0.16s ease;
}

.stat-tile:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.stat-tile__icon {
  width: 34px;
  height: 34px;
  margin-bottom: var(--sp-1);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

.stat-tile__value {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--text);
  line-height: 1;
}

.stat-tile__label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-tile--yellow .stat-tile__value { color: var(--yellow); }
.stat-tile--sky .stat-tile__value { color: var(--sky); }
.stat-tile--green .stat-tile__value { color: var(--green); }
.stat-tile--purple .stat-tile__value { color: var(--purple); }
.stat-tile--orange .stat-tile__value { color: var(--orange); }

/* ========================= CARD DE BRAWLER ============================== */
.brawler-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: linear-gradient(180deg, var(--surface-500) 0%, var(--surface-600) 100%);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.16s var(--ease-pop), border-color 0.16s ease, box-shadow 0.16s ease;
}

/* Efeito de seleção sutil ao escolher um personagem */
.brawler-card:hover,
.brawler-card:focus-visible {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--yellow);
  box-shadow: var(--shadow-pop), 0 0 0 3px rgba(255, 206, 40, 0.25);
}

.brawler-card__art {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-700);
}

.brawler-card__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s var(--ease-pop);
}

.brawler-card:hover .brawler-card__art img {
  transform: scale(1.06);
}

.brawler-card__power {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  padding: 0.1rem 0.5rem;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--on-yellow);
  background: var(--yellow);
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 0 var(--yellow-shadow);
}

.brawler-card__name {
  font-size: var(--fs-md);
  text-align: center;
}

.brawler-card__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

/* Grid reutilizável de brawlers */
.brawler-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-4);
}

/* ======================= AVATAR / CLUBE / MEMBRO ======================== */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--line-strong);
  background: var(--bg-700);
  flex: none;
}

/* ============================== CHIP ==================================== */
/* Chip de informação compacto (clube, região, modo) */
.meta-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-soft);
  background: none;
  border: 0;
  border-bottom: 2px solid var(--line-strong);
}

.meta-link svg {
  width: 1em;
  height: 1em;
  color: var(--sky);
}

/* ==================== LAYOUT COMPARTILHADO ENTRE PÁGINAS ================ */
/* Estes blocos vivem aqui (e não em players.css/brawlers.css) porque são
   usados por várias páginas: perfil, catálogo, ficha, rankings e clube. */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* Cabeçalho de bloco com título + etiqueta */
.brawlers-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.brawlers-head h2 {
  font-size: var(--fs-xl);
}

/* Trilha de navegação (Início / seção / página) */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--yellow); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* Linha de filtros (busca + selects) */
.filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.filter-count {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.brawlers-more {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-5);
}

/* Estado vazio de filtro */
.empty-filter {
  padding: var(--sp-5);
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
}

/* ------------------------------ Paginação ------------------------------ */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.pager-btn {
  min-width: 42px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--text-soft);
  background: var(--surface-500);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease;
}

.pager-btn:hover:not(:disabled) {
  background: var(--surface-400);
  color: var(--text);
}

.pager-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.pager-btn--active {
  background: var(--yellow);
  color: var(--on-yellow);
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 3px 0 var(--yellow-shadow);
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Sub-etiquetas do card de Brawler (usadas no catálogo e no perfil) */
.brawler-card__hc {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  padding: .05rem .4rem;
  font-family: var(--font-display);
  font-size: .7rem;
  letter-spacing: .04em;
  color: #fff;
  background: var(--purple);
  border: 2px solid rgba(0,0,0,.3);
  border-radius: var(--radius-xs);
  box-shadow: 0 2px 0 var(--purple-shadow);
}

.brawler-card__sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  margin-top: var(--sp-1);
}

/* ============================ AVISO FLUTUANTE =========================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-6);
  transform: translateX(-50%) translateY(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: min(92vw, 460px);
  padding: 0.75rem 1.15rem;
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface-500);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-pop);
}

.toast svg {
  width: 1.35em;
  height: 1.35em;
  flex: none;
  color: var(--sky);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================ RESPONSIVO ================================ */
@media (max-width: 640px) {
  .btn {
    padding: 0.65rem 1.2rem;
  }
  .btn--lg {
    padding: 0.8rem 1.4rem;
  }
  /* .section e .container já são ajustados no bloco mobile do base.css */
  .container {
    padding-inline: var(--sp-4);
  }

  /* Cards e tiles mais enxutos para não dominarem a tela */
  .card { padding: var(--sp-4); }
  .stat-tile { padding: var(--sp-3) var(--sp-4); }
  .stat-tile__value { font-size: var(--fs-xl); }

  /* Cabeçalho de bloco compacto (título quebra junto da etiqueta) */
  .brawlers-head { flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
  .brawlers-head h2 { font-size: var(--fs-lg); }

  /* Grade de Brawlers com cards menores: 2 colunas em telas comuns */
  .brawler-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: var(--sp-3);
  }

  .pager { gap: var(--sp-1); }
  .pager-btn { min-width: 38px; padding: 0.4rem 0.7rem; }

  /* Trilha e filtros mais compactos */
  .breadcrumb { flex-wrap: wrap; }
  .filters { gap: var(--sp-2); margin-bottom: var(--sp-2); }

  .toast { left: var(--sp-4); right: var(--sp-4); transform: translateY(20px); max-width: none; }
  .toast.is-visible { transform: translateY(0); }
}

@media (max-width: 400px) {
  /* Toque confortável e tipografia reduzida no celular estreito */
  .btn { padding: 0.6rem 1rem; font-size: var(--fs-sm); }
  .btn--sm { padding: 0.4rem 0.85rem; }
  .card { padding: var(--sp-3); border-radius: var(--radius); }
  .meta-label { padding: 0; letter-spacing: 0.02em; }
  .meta-link { padding: 0; font-size: var(--fs-xs); }
  .input { padding: 0.7rem 0.9rem; font-size: var(--fs-base); }
  .brawler-grid { gap: var(--sp-2); grid-template-columns: repeat(2, 1fr); }
  .brawler-card__name { font-size: var(--fs-base); }
  .avatar { width: 40px; height: 40px; }

  /* Tiles de estatística bem compactos (cabe 2 colunas com números longos) */
  .stat-tile { padding: var(--sp-3) var(--sp-4); }
  .stat-tile__value { font-size: var(--fs-lg); }
  .stat-tile__label { font-size: var(--fs-xs); }
  .stat-tile__icon { width: 28px; height: 28px; }
}
