/**
 * MSL Overlay - Estilos para vMix
 * Design broadcast: fundo transparente, blur, 1920x1080
 */

html, body {
  background: transparent !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Quadro 16:9 (1080p) — não estica com min-vh em monitores altos; painéis laterais usam esse teto. */
.overlay-body {
  width: min(1920px, 100vw);
  height: min(1080px, 100vh);
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  background: transparent;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #fff;
}

/* Preview no navegador (?preview=1): fundo escuro para ver o conteúdo. vMix usa URL sem preview. */
.overlay-body.preview-mode {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.overlay-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/**
 * Painéis “de lado”: mesma largura.
 * Eventos = altura curta (só terço superior do 1080p); stats-final pode usar teto maior.
 */
:root {
  --overlay-side-panel-width: min(720px, 96vw);
  --overlay-canvas-height: min(1080px, 100vh);
  /* Estatísticas / outros painéis laterais longos */
  --overlay-side-panel-max-height: min(960px, calc(var(--overlay-canvas-height) - 80px));
}

/* Eventos: painel no topo — largura fixa (não cresce com o texto) */
.overlay-container .eventos-overlay {
  align-self: flex-start;
  margin-top: 32px;
  min-width: 0;
  width: var(--eventos-panel-width, 660px);
  max-width: min(var(--eventos-panel-width, 660px), calc(100vw - 48px));
}

/* --- CONTAGEM (até o apito) --- */
.countdown-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
}

.countdown-overlay .countdown-loading {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1rem;
}

.countdown-box {
  text-align: center;
  padding: 20px 36px !important;
  min-width: 280px;
}

.countdown-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(226, 232, 240, 0.95);
  margin-bottom: 8px;
}

.countdown-time {
  font-family: 'Segoe UI', ui-monospace, monospace;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  color: #f8fafc;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65);
  font-variant-numeric: tabular-nums;
}

.countdown-sub {
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.95);
}

/* Caixa central (safe area para broadcast) */
.overlay-box {
  max-width: 1400px;
  padding: 32px 48px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* --- PLACAR --- */
.placar-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 180px;
  width: 100%;
  max-width: min(1680px, 98vw);
  box-sizing: border-box;
}

.placar-overlay > .overlay-box {
  max-width: min(1600px, 96vw);
  overflow: visible;
}

.placar-loading,
.eventos-loading,
.escalacao-loading {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.25rem;
}

/**
 * Texto claro precisa de “chapa” escura — senão, no browser (fundo branco) ou se overlay.css
 * atrasar, parece página em branco (vMix em modo Browser costuma ser transparente).
 */
.eventos-loading {
  display: inline-block;
  align-self: flex-start;
  margin-top: 8px;
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.placar-teams {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: min(1600px, 96vw);
  flex-wrap: nowrap;
}

.placar-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  min-width: min-content;
  max-width: none;
}

.placar-team-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.placar-team-name {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  line-height: 1.25;
  white-space: nowrap;
  max-width: none;
}

.placar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 120px;
}

.placar-score {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.placar-score-sep {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.placar-status {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.placar-status-live {
  color: #22c55e;
  font-weight: 700;
}

.placar-fallback {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  text-align: center;
}

/* --- EVENTOS --- */
/* Largura e altura da lista fixas; conteúdo só rola por dentro (não estica o painel). */
.eventos-overlay {
  /* +3 “colunas” (~60px cada) em relação ao painel estreito */
  --eventos-panel-width: 660px;
  /* altura fixa da lista + mais uma linha (~28px) */
  --eventos-scroll-height: 668px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: var(--eventos-panel-width);
  max-width: min(var(--eventos-panel-width), calc(100vw - 48px));
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  flex: 0 0 auto;
  max-height: min(calc(var(--eventos-scroll-height) + 120px), calc(100vh - 48px));
}

.eventos-overlay .overlay-box.eventos-box {
  padding: 10px 12px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.eventos-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.eventos-scroll-wrap {
  height: var(--eventos-scroll-height, 668px);
  max-height: var(--eventos-scroll-height, 668px);
  min-height: var(--eventos-scroll-height, 668px);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.eventos-scroll-wrap::-webkit-scrollbar {
  width: 8px;
}

.eventos-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.eventos-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.eventos-list--full .eventos-item {
  padding: 6px 10px;
  font-size: 0.9em;
}

.eventos-list--full .eventos-text {
  font-size: 0.95rem;
}

.eventos-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border-left: 4px solid transparent;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.eventos-item--goal {
  border-left-color: #22c55e;
}

.eventos-item--card-yellow {
  border-left-color: #eab308;
}

.eventos-item--card-red {
  border-left-color: #ef4444;
}

.eventos-item--subst {
  border-left-color: #3b82f6;
}

.eventos-item--var {
  border-left-color: #a855f7;
}

.eventos-item--phase {
  border-left-color: rgba(148, 163, 184, 0.95);
  background: rgba(148, 163, 184, 0.12);
}

.eventos-item--phase .eventos-text {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
}

.eventos-minute {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  min-width: 40px;
  max-width: 52px;
  line-height: 1.3;
  padding-top: 2px;
}

.eventos-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
  width: 28px;
  text-align: center;
  line-height: 1.3;
  padding-top: 2px;
}

.eventos-text {
  flex: 1 1 0;
  min-width: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.eventos-fallback,
.eventos-fallback-box,
.eventos-empty {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  text-align: center;
  padding: 24px;
}

.eventos-fallback-box {
  max-width: min(660px, 96vw);
  background: rgba(0, 0, 0, 0.85);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.92);
}

/* --- DADOS DO JOGO (canto inferior direito, tamanho fixo do painel) --- */
.match-info-root {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 950;
  box-sizing: border-box;
}

.match-info-loading {
  position: absolute;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 14px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.75);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.match-info-panel {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: min(380px, calc(100vw - 40px));
  max-height: min(420px, 52vh);
  overflow: hidden;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.match-info-line {
  display: grid;
  grid-template-columns: minmax(96px, 34%) 1fr;
  gap: 8px;
  align-items: start;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  line-height: 1.35;
}

/* Garante ocultação mesmo se o UA não aplicar [hidden] sobre display:grid */
.match-info-line[hidden] {
  display: none !important;
}

.match-info-label {
  color: rgba(148, 163, 184, 0.95);
  font-weight: 600;
  flex-shrink: 0;
}

.match-info-value {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* --- ESCALAÇÃO (estilo broadcast) --- */
.escalacao-overlay {
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.escalacao-box {
  max-width: 900px;
  width: 100%;
  box-sizing: border-box;
  padding: 24px 32px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.escalacao-teams {
  display: flex;
  gap: 32px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
}

/* Largura fixa por time: gols/cartões não alargam a barra — só o nome encolhe/abrevia (JS) */
.escalacao-team {
  flex: 0 0 380px;
  width: 380px;
  max-width: 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  box-sizing: border-box;
}

.escalacao-team-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.escalacao-team-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.escalacao-team-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.escalacao-coach {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.02em;
}

.escalacao-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.escalacao-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.escalacao-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 0 6px 6px 0;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.escalacao-item.escalacao-sub {
  background: rgba(255, 255, 255, 0.02);
  border-left-color: rgba(255, 255, 255, 0.12);
}

.escalacao-item.escalacao-subst {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.15);
  border-left-color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Linha única como antes: sai ↩' ↔ entra ↪' — setas com flex-shrink: 0 para não sumirem */
.escalacao-subst-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  width: 100%;
}

.escalacao-subst-row .escalacao-subst-player {
  min-width: 0;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.escalacao-subst-row .escalacao-eventos {
  flex-shrink: 0;
}

.escalacao-subst-row .escalacao-subst-arrow {
  flex-shrink: 0;
  white-space: nowrap;
}

/** Nome do jogador na linha de substituição (reutiliza classe de cartão dos titulares). */
.escalacao-subst-player {
  display: inline-block;
  max-width: 100%;
}

.escalacao-subst-player.escalacao-item--yellow {
  border: none;
  background: transparent;
  padding: 0;
  color: #facc15;
  font-weight: 800;
}

.escalacao-subst-player.escalacao-item--red {
  border: none;
  background: transparent;
  padding: 0;
  color: #ef4444;
  font-weight: 800;
}

.escalacao-subst-arrow {
  opacity: 0.85;
  font-weight: 700;
}

.escalacao-num {
  flex-shrink: 0;
  min-width: 30px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
}

.escalacao-pos {
  flex-shrink: 0;
  min-width: 38px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.escalacao-nome {
  flex: 1;
  min-width: 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.escalacao-item--yellow {
  border-left-color: #eab308;
  background: rgba(234, 179, 8, 0.12);
}
.escalacao-item--yellow .escalacao-nome {
  color: #facc15;
}
.escalacao-item--red .escalacao-nome {
  color: #ef4444;
}

.escalacao-eventos {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-left: 8px;
  white-space: nowrap;
}

.escalacao-eventos .escalacao-2y {
  font-size: 0.65em;
  vertical-align: middle;
}

.escalacao-fallback-box,
.escalacao-fallback {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  text-align: center;
  padding: 24px;
}

/* --- TICKER (barra inferior estilo Uniscore) --- */
.ticker-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.ticker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1920px;
  padding: 16px 32px;
  background: rgba(0, 0, 0, 0.85);
  border-top: 2px solid rgba(59, 130, 246, 0.5);
  gap: 20px;
  box-sizing: border-box;
}

.ticker-team {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-start;
}

.ticker-away {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.ticker-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.ticker-team-name {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: visible;
  flex: 0 0 auto;
  max-width: none;
}

.ticker-stats {
  display: flex;
  gap: 12px;
  font-size: 0.95rem;
}

.ticker-stat em {
  font-style: normal;
  font-weight: 700;
  margin-left: 2px;
}

.ticker-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 120px;
}

.ticker-time {
  font-size: 1rem;
  font-weight: 600;
  color: #22c55e;
}

.ticker-score {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ticker-ht {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.ticker-loading,
.ticker-fallback {
  color: rgba(255, 255, 255, 0.7);
  padding: 24px;
}

/* --- MOMENTUM (gráfico esticado + campo 3D) --- */
.momentum-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  width: 100%;
}

.momentum-box {
  width: 100%;
  max-width: 100%;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

.momentum-box--stretched {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  max-width: min(1920px, 100%);
  box-sizing: border-box;
  /* Mais ar na esquerda: o campo 3D com rotateZ encostava no padding / no canto arredondado */
  padding-left: 22px;
}

/* Campo 3D (esquerda) — um pouco mais baixo para o card inteiro ficar mais compacto na vertical */
.momentum-field3d {
  flex: 0 0 260px;
  min-width: 228px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 800px;
  padding-left: 8px;
  box-sizing: border-box;
  overflow: visible;
}

.momentum-field3d-inner {
  width: 100%;
  aspect-ratio: 105/68;
  position: relative;
  transform: rotateX(38deg) rotateZ(8deg);
  transform-style: preserve-3d;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.momentum-field3d-grass {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    #228b22 0px,
    #228b22 14px,
    #1e7b1e 14px,
    #1e7b1e 28px
  );
}

.momentum-field3d-markings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Seção do gráfico (direita, esticada) — só respiro vertical; largura inalterada */
.momentum-graph-section {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.momentum-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 2px 0;
  background: transparent;
}

.momentum-time-now {
  flex-shrink: 0;
  font-size: clamp(1rem, 1.5vw, 1.225rem);
  font-weight: 700;
  color: #00FF7F;
  padding: 3px 8px;
  background: rgba(0, 255, 127, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 127, 0.3);
}

.momentum-stats-one-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 1.125rem;
}

.momentum-stats-dash {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  font-size: 1.7rem;
  flex-shrink: 0;
  line-height: 1;
  align-self: center;
}

.momentum-home-one-line .momentum-stats-dash,
.momentum-away-one-line .momentum-stats-dash {
  position: relative;
  top: 0.05em;
}

.momentum-stats-values-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.momentum-stats-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 1.25rem;
}

.momentum-stats-row--home {
  background: rgba(74, 222, 128, 0.15);
  border-left: 4px solid #4ade80;
}

.momentum-stats-row--away {
  background: rgba(147, 197, 253, 0.15);
  border-left: 4px solid #93c5fd;
}

.momentum-stats-team {
  font-weight: 800;
  font-size: 1.4rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  flex-shrink: 0;
}

.momentum-stats-row--home .momentum-stats-team {
  color: #4ade80;
}

.momentum-stats-row--away .momentum-stats-team {
  color: #93c5fd;
}

.momentum-stat-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65em;
  min-width: 0;
  flex-shrink: 0;
}

.momentum-stat-val {
  font-style: normal;
  font-weight: 800;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.5);
  min-width: 4.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.momentum-stat-label {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
  font-size: clamp(1.03rem, 1.25vw, 1.23rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
  white-space: nowrap;
}

.momentum-chart {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 4px;
  flex: 1;
  min-height: 144px;
}

.momentum-logos {
  flex: 0 0 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0;
}

.momentum-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.momentum-chart-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.momentum-home-label,
.momentum-away-label {
  font-size: clamp(1.3rem, 1.75vw, 1.65rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.65);
  letter-spacing: 0.02em;
}

.momentum-home-label {
  color: #4ade80;
}

.momentum-away-label {
  color: #93c5fd;
}

.momentum-home-one-line {
  display: grid;
  grid-template-columns: minmax(0, min(28ch, 22vw)) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.4rem;
  row-gap: 0.15rem;
  padding: 3px 0 5px 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(74, 222, 128, 0.35);
  min-width: 0;
}

.momentum-home-one-line .momentum-home-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}

/* 6 colunas: cartões com um pouco mais de espaço (ícones + totais) */
.momentum-home-stats-inline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(108px, 1.45fr);
  align-items: center;
  justify-items: center;
  column-gap: clamp(4px, 0.85vw, 12px);
  width: 100%;
  min-width: 0;
}

.momentum-home-stats-inline .momentum-stat-val {
  color: #4ade80;
}

.momentum-home-stats-inline .momentum-stat-label {
  color: rgba(255, 255, 255, 0.85);
}

.momentum-away-one-line {
  display: grid;
  grid-template-columns: minmax(0, min(28ch, 22vw)) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.4rem;
  row-gap: 0.15rem;
  padding: 3px 0 5px 0;
  margin-top: 0;
  border-top: 1px solid rgba(147, 197, 253, 0.35);
  min-width: 0;
}

.momentum-away-one-line .momentum-away-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}

.momentum-away-stats-inline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(108px, 1.45fr);
  align-items: center;
  justify-items: center;
  column-gap: clamp(4px, 0.85vw, 12px);
  width: 100%;
  min-width: 0;
}

.momentum-away-stats-inline .momentum-stat-val {
  color: #93c5fd;
}

.momentum-away-stats-inline .momentum-stat-label {
  color: rgba(255, 255, 255, 0.85);
}

/* Cada stat: ocupa a célula — reserva largura pro %/número para não colidir com o rótulo */
.momentum-home-stats-inline .momentum-stat-item,
.momentum-away-stats-inline .momentum-stat-item {
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex-shrink: 1;
  flex-wrap: nowrap;
}

.momentum-home-stats-inline .momentum-stat-item:not(:last-child),
.momentum-away-stats-inline .momentum-stat-item:not(:last-child) {
  gap: clamp(6px, 0.55em, 12px);
}

/* Cartões: empilha número/ícones e rótulo para não estourar a largura */
.momentum-home-stats-inline .momentum-stat-item:last-child,
.momentum-away-stats-inline .momentum-stat-item:last-child {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 2px;
}

.momentum-home-stats-inline .momentum-stat-item:last-child .momentum-stat-val,
.momentum-away-stats-inline .momentum-stat-item:last-child .momentum-stat-val {
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: normal;
  line-height: 1.1;
}

.momentum-home-stats-inline .momentum-stat-item:last-child .momentum-stat-label,
.momentum-away-stats-inline .momentum-stat-item:last-child .momentum-stat-label {
  font-size: clamp(0.93rem, 1.05vw, 1.13rem);
  line-height: 1;
}

/* Stats do momentum — compacto na vertical; rótulos longos sem abreviar */
.momentum-home-stats-inline .momentum-stat-val,
.momentum-away-stats-inline .momentum-stat-val {
  font-size: clamp(1.37rem, 1.95vw, 1.9rem);
  min-width: 0;
  flex-shrink: 1;
}

.momentum-home-stats-inline .momentum-stat-item:not(:last-child) .momentum-stat-val,
.momentum-away-stats-inline .momentum-stat-item:not(:last-child) .momentum-stat-val {
  min-width: 5.25ch;
  flex-shrink: 0;
}

.momentum-home-stats-inline .momentum-stat-item:last-child .momentum-stat-val,
.momentum-away-stats-inline .momentum-stat-item:last-child .momentum-stat-val {
  font-size: clamp(1.17rem, 1.45vw, 1.53rem);
}

.momentum-home-stats-inline .momentum-stat-label,
.momentum-away-stats-inline .momentum-stat-label {
  font-size: clamp(0.97rem, 1.15vw, 1.17rem);
}

/* Gráfico + marcadores HTML (minuto ao lado do ícone; SVG de barras inalterado em tamanho) */
.momentum-chart-layer {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.momentum-markers-html {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
}

.momentum-marker-wrap {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 24%;
  user-select: none;
}

/* Lances encostados na borda da faixa, não sobre o miolo das barras */
.momentum-marker-wrap--top {
  top: 6px;
}

.momentum-marker-wrap--bot {
  bottom: 6px;
}

.momentum-marker-goal {
  flex-shrink: 0;
  font-size: clamp(21px, 1.9vw, 30px);
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9));
}

.momentum-marker-time {
  flex-shrink: 1;
  min-width: 0;
  font-size: clamp(10px, 0.75vw, 12px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* Cartões um pouco menores que a primeira versão; bola (.momentum-marker-goal) mantém o clamp acima */
.momentum-marker-card {
  flex-shrink: 0;
  width: clamp(18px, 1.65vw, 26px);
  height: clamp(22px, 2.05vw, 32px);
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.momentum-marker-card--yellow {
  background: #eab308;
}

.momentum-marker-card--red {
  background: #ef4444;
}

.momentum-svg {
  flex: 1;
  min-height: 136px;
  max-height: 152px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
}

.momentum-xaxis {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.905rem, 1.25vw, 1.125rem);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  padding-top: 0;
  line-height: 1.1;
}

.momentum-progress {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.momentum-progress-bar {
  height: 100%;
  background: #1E90FF;
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(30, 144, 255, 0.5);
}

.momentum-loading {
  color: rgba(255, 255, 255, 0.7);
  padding: 24px;
}



/* --- ESTATÍSTICAS FINAIS (painel vertical à direita, pós-jogo) --- */
.overlay-container.overlay-container--stats-final {
  align-items: stretch;
  justify-content: flex-end;
}

.stats-final-overlay {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  padding: 20px 36px 28px 12px;
  box-sizing: border-box;
}

.stats-final-loading,
.stats-final-fallback {
  color: rgba(255, 255, 255, 0.95);
  padding: 20px 24px;
  font-size: 1.1rem;
  align-self: center;
  max-width: min(720px, 92vw);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.stats-final-panel {
  width: var(--overlay-side-panel-width);
  max-height: var(--overlay-side-panel-max-height);
  overflow-x: visible;
  overflow-y: auto;
  padding: 18px 22px 22px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}

.stats-final-panel::-webkit-scrollbar {
  width: 8px;
}
.stats-final-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.stats-final-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.stats-final-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
}

.stats-final-venue {
  font-size: clamp(0.92rem, 1.55vw, 1.12rem);
  font-weight: 600;
  color: rgba(226, 232, 240, 0.88);
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
}

.stats-final-status {
  font-size: clamp(1rem, 1.75vw, 1.28rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fde68a;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.stats-final-scoreline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.stats-final-head-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.stats-final-goals {
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.stats-final-gsep {
  margin: 0 6px;
  opacity: 0.75;
}

.stats-final-names {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  font-size: clamp(0.98rem, 1.55vw, 1.18rem);
  font-weight: 700;
  line-height: 1.2;
}

.stats-final-nh {
  color: #4ade80;
  white-space: nowrap;
  flex: 0 1 auto;
  max-width: none;
}

.stats-final-na {
  color: #93c5fd;
  white-space: nowrap;
  flex: 0 1 auto;
  max-width: none;
}

.stats-final-table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stats-final-row {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) minmax(min-content, 2.2fr) minmax(56px, 1fr);
  gap: 8px 14px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
}

.stats-final-row:last-child {
  border-bottom: none;
}

.stats-final-v {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
}

.stats-final-v--home {
  text-align: right;
  color: #4ade80;
}

.stats-final-v--away {
  text-align: left;
  color: #93c5fd;
}

.stats-final-l {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.95em;
  line-height: 1.2;
  white-space: nowrap;
  hyphens: none;
  word-break: normal;
  overflow: visible;
  min-width: min-content;
}

.stats-final-loading-inline,
.stats-final-empty {
  padding: 16px 8px;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
}

/* --- LIVE (overlay unificado) --- */
.live-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.live-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.live-pitch {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  min-height: 0;
}

.live-pitch-inner {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 1.5;
  background: linear-gradient(90deg, rgba(34, 139, 34, 0.4) 0%, rgba(34, 139, 34, 0.5) 50%, rgba(34, 139, 34, 0.4) 100%);
  border: 3px solid rgba(59, 130, 246, 0.6);
  border-radius: 12px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.3);
}

.live-scorers {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

.live-scorer {
  white-space: nowrap;
}

.live-floating {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.live-floating-card {
  display: flex;
  align-items: stretch;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 12px;
  overflow: hidden;
  border-left: 4px solid #3b82f6;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.live-floating-card.live-floating-visible {
  opacity: 1;
  transform: translateX(0);
}

.live-floating-label {
  padding: 12px 20px;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.live-floating-body {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
}

.live-floating-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.live-floating-team {
  font-weight: 700;
  font-size: 1rem;
}

.live-floating-player {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.live-floating-minute {
  font-weight: 700;
  font-size: 1.1rem;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
  padding: 6px 14px;
  border-radius: 6px;
  margin-left: 16px;
}

.live-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.9);
  border-top: 2px solid rgba(59, 130, 246, 0.4);
  gap: 16px;
  box-sizing: border-box;
}

.live-ticker .ticker-team {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

.live-ticker .ticker-away {
  flex-direction: row-reverse;
}

.live-ticker .ticker-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.live-ticker .ticker-team-name {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: visible;
  flex: 0 0 auto;
  max-width: none;
}

.live-ticker .ticker-stat {
  font-size: 0.9rem;
}

.live-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.live-time {
  font-size: 0.95rem;
  font-weight: 600;
  color: #22c55e;
}

.live-score {
  font-size: 1.8rem;
  font-weight: 800;
}

.live-ht {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.live-loading {
  color: rgba(255, 255, 255, 0.7);
  padding: 24px;
}
