/* =============================================================================
   BRAWL HUB — Home
   Layout do hero, funcionalidades e rodapé.
   (O cabeçalho/menu mobile vive no base.css, pois é comum a todas as páginas.)
   ========================================================================== */

/* ================================ HERO ================================== */
.hero {
  position: relative;
  padding-block: var(--sp-8) var(--sp-9);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--sp-8);
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.hero h1 {
  font-size: var(--fs-hero);
  margin-bottom: var(--sp-4);
}

.hero h1 .accent {
  color: var(--yellow);
  display: inline-block;
  transform: rotate(-2deg);
}

.hero__lead {
  font-size: var(--fs-lg);
  color: var(--text-soft);
  max-width: 30ch;
  margin-bottom: var(--sp-6);
}

/* ------------------------------------------------------ Formulário ------ */
.search {
  display: flex;
  gap: var(--sp-3);
  max-width: 520px;
  padding: var(--sp-3);
  background: var(--bg-700);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-inset);
}

.search-shell {
  position: relative;
  width: min(100%, 520px);
}

.search-shell .search { max-width: none; }

.search-history {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 20;
  padding: var(--sp-2);
  background: var(--surface-600);
  border: 3px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  transform-origin: top center;
}

.search-history.is-open {
  animation: history-drop 0.18s var(--ease-pop) both;
}

.search-history__item {
  display: flex;
  align-items: stretch;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--line);
}

.search-history__item:last-child { border-bottom: 0; }

.search-history__choose {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.65rem;
  color: var(--text);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.search-history__choose:hover,
.search-history__choose:focus-visible { color: var(--yellow); }
.search-history__choose strong { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.search-history__choose span { color: var(--sky); font-size: var(--fs-xs); font-weight: 800; }

.search-history__remove {
  align-self: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font-size: var(--fs-lg);
  cursor: pointer;
}

.search-history__remove:hover,
.search-history__remove:focus-visible { color: var(--red); }

@keyframes history-drop {
  from { opacity: 0; transform: translateY(-6px) scaleY(0.96); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.search .input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.5rem 0.7rem;
  box-shadow: none;
}

.search .input:focus {
  box-shadow: none;
}

.search:focus-within {
  border-color: var(--sky);
}

/* Feedback de validação da tag */
.search__hint {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  min-height: 1.5rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
}

.search__hint { margin-bottom: 0; }

.search__hint[data-state="error"] { color: var(--red); }
.search__hint[data-state="ok"] { color: var(--green); }

.search__hint svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

/* ------------------------------------------ Composição de ilustrações --- */
.hero__art {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 390px;
  min-width: 0;
  margin-inline: auto;
  isolation: isolate;
}

.hero__art .brawler-float {
  position: absolute;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 16px 24px rgba(4, 10, 30, 0.55));
  animation: float 5s ease-in-out infinite;
}

.hero__art .brawler-float img {
   display: block;
   width: 100%;
   height: 100%;
   object-fit: contain;
   border-radius: var(--radius-lg);
}

.hero__art .b1 { width: 44%; top: 4%; left: 4%; animation-delay: 0s; z-index: 3; }
.hero__art .b2 { width: 40%; top: 0%; right: 2%; animation-delay: 0.6s; z-index: 2; }
.hero__art .b3 { width: 42%; bottom: 6%; left: 16%; animation-delay: 1.2s; z-index: 4; }
.hero__art .b4 { width: 34%; bottom: 2%; right: 6%; animation-delay: 1.8s; z-index: 1; }

/* Troféu flutuante decorativo */
.hero__trophy {
  position: absolute;
  top: 47%;
  left: 50%;
  width: 92px;
  z-index: 5;
  transform: translate(-50%, -50%);
  animation: trophy-float 4s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
  object-fit: contain;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes trophy-float {
  0%, 100% { transform: translate(-50%, -50%) rotate(-3deg); }
  50% { transform: translate(-50%, calc(-50% - 12px)) rotate(3deg); }
}


@media (max-width: 768px) {
  /* Mobile: remove a arte e sua célula por completo, sem espaço residual. */
  .hero__art { display: none; }
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .hero__lead { max-width: none; }
}

@media (max-width: 560px) {
  .search {
    flex-direction: column;
  }
  .search .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__art *,
  .hero__art {
    animation: none !important;
    transition: none !important;
  }
}

/* Cartão do jogador */
.player-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(120deg, var(--surface-500), var(--surface-600));
  border: 3px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.player-card__art {
  width: 78px;
  height: 78px;
  border-radius: var(--radius);
  border: 4px solid var(--yellow);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 6px 16px rgba(0, 0, 0, 0.4);
  background: var(--bg-700);
  flex: none;
  object-fit: cover;
}

.player-card__meta { flex: 1; min-width: 180px; }

.player-card__name {
  font-size: var(--fs-xl);
  margin-bottom: var(--sp-1);
}

.player-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.player-card__trophies {
  text-align: right;
}

.player-card__trophies .trophy-pill {
  font-size: var(--fs-2xl);
}

@media (max-width: 480px) {
  .player-card__trophies { text-align: left; }
}

/* ========================== FUNCIONALIDADES ============================= */
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}

.feature {
  position: relative;
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  overflow: hidden;
  transition: transform 0.18s var(--ease-pop);
}

.feature:hover {
  transform: translateY(-6px);
}

.feature__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin-bottom: var(--sp-4);
  border-radius: var(--radius);
  border: 3px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25), var(--shadow-inset);
}

.feature__icon svg {
  width: 38px;
  height: 38px;
  color: #12203f;
}

.feature--yellow .feature__icon { background: var(--yellow); }
.feature--sky .feature__icon { background: var(--sky); }
.feature--purple .feature__icon { background: var(--purple); }
.feature--purple .feature__icon svg { color: #fff; }

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

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

@media (max-width: 860px) {
  .features__grid { grid-template-columns: 1fr; }
}

/* ============================== RODAPÉ ================================== */
.footer {
  margin-top: var(--sp-8);
  background: var(--bg-800);
  border-top: 4px solid var(--line);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: var(--sp-6);
  padding-block: var(--sp-7) var(--sp-5);
}

.footer__about p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  max-width: 42ch;
  margin-top: var(--sp-3);
}

.footer h5 {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: var(--sp-3);
}

.footer__links li + li {
  margin-top: var(--sp-2);
}

.footer__links a {
  color: var(--text-soft);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.footer__links a:hover {
  color: var(--yellow);
}

/* Aviso de independência — obrigatório (seção 1.4) */
.footer__disclaimer {
  padding: var(--sp-4);
  background: var(--bg-900);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.footer__disclaimer strong {
  color: var(--text-soft);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-4);
  border-top: 2px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

@media (max-width: 760px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ========================== RESPONSIVO MOBILE =========================== */
@media (max-width: 640px) {
  .hero { padding-block: var(--sp-6) var(--sp-7); }
  .hero__inner { gap: var(--sp-5); }
  .hero__art { max-width: 300px; }
  .hero__lead { font-size: var(--fs-base); margin-bottom: var(--sp-5); }
  .search { padding: var(--sp-2); gap: var(--sp-2); }

  .features__grid { gap: var(--sp-4); }
  .feature { padding: var(--sp-5) var(--sp-4); }
  .feature__icon { width: 64px; height: 64px; margin-bottom: var(--sp-3); }
  .feature__icon svg { width: 32px; height: 32px; }

  .player-card { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }

  .footer { margin-top: var(--sp-6); }
  .footer__grid { gap: var(--sp-5); padding-block: var(--sp-6) var(--sp-4); }
}

@media (max-width: 480px) {
  /* Título do hero um passo menor para não ocupar a tela toda */
  .hero h1 { font-size: clamp(2rem, 8vw, 2.6rem); }
  .hero__art { max-width: 250px; }
  .hero__trophy { width: 54px; }

  /* Cartão do jogador: arte menor e troféus rebaixados para a linha de baixo */
  .player-card__art { width: 62px; height: 62px; }
  .player-card__name { font-size: var(--fs-lg); }
  .player-card__meta { min-width: 140px; }

  .feature__icon { width: 56px; height: 56px; }
  .feature__icon svg { width: 28px; height: 28px; }

  .footer__bottom { justify-content: center; text-align: center; }
  .footer__disclaimer { padding: var(--sp-3); }
}
