/* match_header.css - Cabeçalho do Pré-Match (refatorado, sem bordas arredondadas)
   Objetivos:
   - Layout coerente com o pós-match (card escuro, bordas finas, sombras suaves)
   - Responsivo (mobile → desktop) com menos regras duplicadas
   - Sem border-radius em qualquer breakpoint
*/

:root {
  --pm-maxw: 1240px;
  --pm-gutter: clamp(12px, 2.2vw, 28px);
  --pm-pad: clamp(14px, 2.4vw, 28px);
  --pm-gap: clamp(10px, 2vw, 22px);

  --pm-border: rgba(255, 255, 255, 0.10);

  --pm-text: #f0f0f0;
  --pm-muted: #a7a7a7;
  --pm-accent: #1a73e8;

  --pm-good: #22c55e;
  --pm-neutral: #a3a3a3;
  --pm-bad: #ef4444;

  --pm-radius: 0px;
  --pm-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

/* A seção do header não controla largura; quem controla é o wrapper (#pre-match-app / .pre-match-container) */
.pmatch {
  width: 100%;
}

/* Card principal */
.pmatch .match-header-card {
  width: 100%;
  padding: var(--pm-pad);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 18px);
  color: var(--pm-text);
}

/* Times + VS */
.pmatch .teams-with-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--pm-gap);
}

.pmatch .team-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.pmatch .team {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.pmatch .team-logo {
  width: clamp(52px, 6.2vw, 94px);
  height: clamp(52px, 6.2vw, 94px);
  object-fit: contain;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
  padding: 8px;
}

.pmatch .team-name {
  margin: 10px 0 0;
  font-weight: 650;
  font-size: clamp(0.95rem, 1.25vw, 1.35rem);
  line-height: 1.15;
  max-width: 18ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hover/Focus acessível */
.pmatch .team-link:hover .team-name,
.pmatch .team-link:focus-visible .team-name {
  color: var(--pm-accent);
}
.pmatch .team-link:hover .team-logo,
.pmatch .team-link:focus-visible .team-logo {
  border-color: rgba(26, 115, 232, 0.55);
  background: rgba(26, 115, 232, 0.08);
}

.pmatch .vs-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.pmatch .vs {
  font-weight: 850;
  letter-spacing: 0.12em;
  font-size: clamp(1.25rem, 3vw, 2.35rem);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* Info do jogo */
.pmatch .match-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.pmatch .match-info .league {
  color: var(--pm-muted) !important;
  font-weight: 650;
  font-size: 1rem;
}

.pmatch .match-info .datetime {
  color: var(--pm-muted) !important;
  font-weight: 500;
}

.pmatch .match-info .venue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--pm-muted) !important;
  font-size: 0.95rem;
}

/* Divisor */
.pmatch .header-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.18), transparent);
}

/* Base (forma + h2h) – usando grid areas para controle total */
.pmatch .mh-bottom-grid {
  display: grid;
  grid-template-areas: "home h2h away";
  grid-template-columns: 1fr minmax(220px, 1.55fr) 1fr;
  align-items: start;
  gap: var(--pm-gap);
}

.pmatch .home-form {
  grid-area: home;
}

.pmatch .h2h-block {
  grid-area: h2h;
}

.pmatch .away-form {
  grid-area: away;
}

/* Forma */
.pmatch .inline-form {
  text-align: center;
  min-width: 0;
  margin-top: 0;
  padding-top: 0;
}

.pmatch .inline-form .small {
  color: var(--pm-muted) !important;
  font-size: 0.85rem;
  margin-top: 0;
}

.form-seq {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 16px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.dot.win {
  background: var(--pm-good);
}
.dot.draw {
  background: var(--pm-neutral);
}
.dot.loss {
  background: var(--pm-bad);
}

/* Tooltip discreto */
.tt {
  position: relative;
  cursor: help;
}
.tt:hover::after {
  content: attr(data-tt);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 150%;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.86);
  color: #fff;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: var(--pm-radius);
  pointer-events: none;
  z-index: 10;
}
.tt:hover::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(150% - 6px);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.86);
  z-index: 10;
}

/* H2H */
.pmatch .h2h-block {
  text-align: center;
  min-width: 0;
}

.pmatch .h2h-title {
  color: var(--pm-muted) !important;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.pmatch .h2h-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pmatch .h2h-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--pm-border);
  border-radius: var(--pm-radius);
}

.pmatch .h2h-team {
  max-width: 120px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  color: var(--pm-text);
}

.pmatch .h2h-home {
  text-align: right;
  flex: 1;
}
.pmatch .h2h-away {
  text-align: left;
  flex: 1;
}

.pmatch .h2h-score {
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pmatch .h2h-score .divider {
  color: var(--pm-muted);
}
.pmatch .h2h-score .score-home {
  color: var(--pm-good);
}
.pmatch .h2h-score .score-away {
  color: var(--pm-bad);
}

.pmatch .h2h-empty {
  color: var(--pm-muted) !important;
  font-style: italic;
}

/* Observações */
.pmatch .observacoes-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pm-gap);
  padding-top: clamp(12px, 2vw, 18px);
  border-top: 1px solid var(--pm-border);
}

.pmatch .observacoes-box {
  background: rgba(23, 23, 23);
  padding: 14px;
}

.pmatch .observacoes-box h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 750;
  color: var(--pm-text);
}

.pmatch .observacoes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pmatch .observacoes-list li {
  margin: 8px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  padding-left: 8px;
  border-left: 2px solid transparent;
}

.pmatch .observacoes-list li .icon {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.pmatch .observacoes-list li.positivo {
  color: var(--pm-good) !important;
  border-left-color: var(--pm-good);
}
.pmatch .observacoes-list li.neutro {
  color: var(--pm-neutral) !important;
  border-left-color: var(--pm-neutral);
}
.pmatch .observacoes-list li.negativo {
  color: var(--pm-bad) !important;
  border-left-color: var(--pm-bad);
}

/* Premium lock */
.pmatch .observacoes-list .locked-placeholder {
  opacity: 0.9;
  filter: none;
  user-select: none;
  pointer-events: none;
}
.pmatch .observacoes-list .premium-cta {
  margin-top: 10px;
}
.pmatch .premium-banner {
  background: rgba(23, 23, 23) !important;
  padding: 10px 12px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.pmatch .premium-banner .btn {
  flex: 1;
  white-space: nowrap;
  text-align: center;
}

/* =========================
   Responsividade
   ========================= */
@media (max-width: 900px) {
  .pmatch .mh-bottom-grid {
    grid-template-areas:
      "home away"
      "h2h h2h";
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 599px) {
  .pmatch .observacoes-container {
    grid-template-columns: 1fr;
  }
}
  .pmatch .h2h-team {
    max-width: 90px;
  }


@media (max-width: 520px) {
  .pmatch .team-logo {
    width: 52px;
    height: 52px;
    padding: 6px;
  }
  .pmatch .team-name {
    max-width: 14ch;
  }
  .pmatch .mh-bottom-grid {
    grid-template-areas:
      "home"
      "h2h"
      "away";
    grid-template-columns: 1fr;
  }

  /* Reduz tamanho das bolinhas e espaçamento para caber na linha */
  .pmatch .form-seq {
    gap: 4px;
  }
  .pmatch .dot {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 520px) {
  .pmatch .mh-bottom-grid {
    grid-template-areas:
      "home"
      "away"
      "h2h";
    grid-template-columns: 1fr;
  }
}