:root {
  /* Estas variables se heredan de tu archivo principal, pero las pongo aquí como referencia */
  --celeste-primario: var(--primary-color, #00bfff);
  --celeste-claro: var(--primary-light, #e0f7fa);
  --celeste-oscuro: var(--primary-dark, #008fb3);
  --fondo-secundario: var(--secondary-color, #f0f0f0);
  --texto-principal: var(--text-color, #333);
  --texto-secundario: var(--light-text, #757575);
  --blanco: var(--white, #ffffff);
  --negro: var(--black, #000000);
  --verde-positivo: #66bb6a;
  --naranja-neutral: #ffb74d;
  --rojo-negativo: #d62727;
}

/* --- ESTILOS GENERALES Y BASE (Mobile-First) --- */

.match-detail-container {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 1rem;
}

.match-header {
  text-align: center;
  margin-bottom: 2rem;
}

.match-date {
  color: var(--texto-secundario);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.match-header h1 {
  color: var(--celeste-oscuro);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.match-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--celeste-primario), transparent);
  width: 80%;
  margin: 0 auto;
}

.match-result-card,
.match-details {
  background: var(--blanco);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 1rem;
  margin-bottom: 2rem;
}

/* --- TARJETA DE RESULTADO (Siempre Horizontal) --- */
.team-display {
  display: flex;
  justify-content: space-between; /* Mantiene los elementos distribuidos */
  align-items: center;
  gap: 0.5rem; /* Espacio reducido entre elementos para móviles */
}

.team {
  flex: 1; /* Ocupan el espacio disponible */
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0; /* Permite que los elementos se encojan más allá de su contenido */
}

.team-logo {
  width: 50px; /* Tamaño de logo reducido para móviles */
  height: 50px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.team-logo.placeholder {
  background: var(--fondo-secundario);
  border-radius: 50%;
}

.team-name {
  font-weight: 500;
  text-align: center;
  color: var(--texto-principal);
  font-size: 0.8rem; /* Tamaño de fuente reducido para móviles */
  line-height: 1.2; /* Mejora el espaciado si el nombre ocupa dos líneas */
}

.home-team .team-name {
  color: var(--celeste-oscuro);
  font-weight: 600;
}

.match-score {
  flex: 1.2; /* Damos un poco más de espacio al marcador */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0.25rem; /* Padding horizontal reducido */
}

.match-condition {
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.7rem; /* Texto de condición más pequeño */
  font-weight: 500;
  margin-bottom: 0.4rem;
  text-align: center; /* Asegura el centrado si el texto es largo */
}

.match-condition.local { background: var(--celeste-claro); color: var(--negro); }
.match-condition.visitor { background: var(--fondo-secundario); color: var(--texto-principal); }

.score {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem; /* Marcador más pequeño pero aún legible */
  font-weight: 700;
  margin: 0.2rem 0;
}

.goals { text-align: center; }
.separator { margin: 0 0.4rem; }
.vs-text { display: none; } /* Oculto en móviles para ganar espacio */

/* --- SECCIONES DE DETALLES (Sin cambios mayores aquí) --- */
.detail-section { margin-bottom: 1.5rem; }
.detail-section:last-child { margin-bottom: 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--negro);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--fondo-secundario);
}

.section-title.yellow-card { color: var(--naranja-neutral); }
.section-title.red-card { color: var(--rojo-negativo); }

.detail-list { list-style: none; padding: 0; margin: 0; }
.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--fondo-secundario);
}
.detail-item:last-child { border-bottom: none; }
.player-name { font-weight: 500; font-size: 0.9rem; }
.minute-badge {
  background: var(--fondo-secundario);
  color: var(--texto-principal);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.empty-message {
  color: var(--texto-secundario);
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

.match-footer {
  text-align: center;
  margin-top: 1rem;
  color: var(--texto-secundario);
  font-size: 0.8rem;
}

/* --- MEDIA QUERY PARA TABLETAS (A partir de 768px) --- */
/* Aquí empezamos a agrandar todo de nuevo */
@media (min-width: 768px) {
  .match-result-card, .match-details {
    padding: 1.5rem;
  }

  .team-display {
    gap: 1rem; /* Aumentamos el espacio */
  }

  .team-logo {
    width: 80px; /* Logos más grandes */
    height: 80px;
  }

  .team-name {
    font-size: 1rem; /* Nombre de equipo más grande */
  }

  .match-score {
    padding: 0 1rem; /* Más padding para el marcador */
  }

  .match-condition {
    font-size: 0.8rem;
  }

  .score {
    font-size: 2.8rem; /* Marcador más grande */
  }

  .separator {
    margin: 0 0.5rem;
  }

  /* Restauramos el 'vs Rival' que ocultamos en móvil */
  .vs-text {
    display: block;
    text-align: center;
    color: var(--texto-secundario);
    font-weight: 500;
    margin-top: 0.5rem;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .match-header h1 {
    font-size: 1.8rem;
  }
}

/* --- MEDIA QUERY PARA ESCRITORIOS (A partir de 992px) --- */
/* Aprovechamos el espacio para mostrar los detalles en dos columnas */
@media (min-width: 992px) {
  .match-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}