/* Resultados y calendario — tarjeta de partido y navegación de jornada,
   calcadas de 2daDivision/FRONTEND/css/resultados.css con los tokens de
   nuestra paleta. El resto de la página (nav, cabecera, botones de grupo,
   fondo atenuado) ya lo da clasificacion.css, que esta vista también carga:
   no hay motivo para duplicarlo. */

.res-body {
  max-width: 640px;
  margin: 0 auto;
}

.res-jornada-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.res-nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--texto);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.res-nav-btn:hover:not(:disabled) {
  background: var(--marca-tinte);
  border-color: var(--marca);
  color: var(--marca);
}

.res-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.res-select {
  padding: 0.45rem 1rem;
  border: 1px solid var(--borde);
  border-radius: 999px;
  background: var(--superficie);
  color: var(--texto);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  min-width: 150px;
  cursor: pointer;
}

.res-select:focus {
  border-color: var(--marca);
  outline: none;
}

.partidos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: opacity 150ms ease;
}

/* Igual que el cambio de grupo en clasificacion.js: al cambiar de jornada se
   atenúan los partidos ya pintados en vez de vaciar el grid, para que no
   parpadee a "Cargando…" ni salte el pie de página. */
.partidos-grid--cargando {
  opacity: 0.45;
  pointer-events: none;
}

.res-estado {
  text-align: center;
  color: var(--texto-suave);
  padding: 2rem 0;
  font-size: 0.9rem;
}

.res-estado.error {
  color: var(--descenso);
}

.res-estado--reserva {
  min-height: 700px;
}

.partido {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--superficie);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.partido__equipo--local {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.partido__equipo--visitante {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  text-align: right;
  min-width: 0;
}

.partido__escudo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.partido__escudo--placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fondo);
  flex-shrink: 0;
}

.partido__nombre {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partido__marcador {
  font-family: var(--fuente-num);
  font-size: 1.3rem;
  font-weight: 700;
  min-width: 64px;
  text-align: center;
  flex-shrink: 0;
}

.partido__marcador--final {
  color: var(--marca);
}

.partido__marcador--hora {
  color: var(--texto-suave);
  font-size: 0.85rem;
  font-family: var(--fuente);
  font-weight: 600;
}

.partido__fecha {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.72rem;
  color: var(--texto-suave);
  margin-top: 0.1rem;
  text-transform: capitalize;
}

/* Directo. Verde y no el rojo de marca: el rojo ya significa "resultado
   final" en esta misma tarjeta. #15803d sobre blanco da 5,0:1. */
.partido {
  --vivo: #15803d;
}

.partido__marcador--vivo {
  color: var(--vivo);
}

.partido__fecha--vivo {
  color: var(--vivo);
  font-weight: 700;
  text-transform: none;
}

.partido__fecha--vivo::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.35em;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.1em;
  animation: latido-directo 1.6s ease-in-out infinite;
}

@keyframes latido-directo {
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .partido__fecha--vivo::before {
    animation: none;
  }
}

@media (max-width: 480px) {
  .partido {
    padding: 0.75rem 0.6rem;
    gap: 0.2rem 0.4rem;
  }
  .partido__escudo,
  .partido__escudo--placeholder {
    width: 22px;
    height: 22px;
  }
  .partido__nombre {
    font-size: 0.7rem;
  }
  .partido__marcador {
    font-size: 1.05rem;
    min-width: 48px;
  }
  .partido__marcador--hora {
    font-size: 0.75rem;
  }
}
