:root {
  --celeste-primario: var(--primary-color);
  --celeste-claro: var(--primary-light);
  --celeste-oscuro: var(--primary-dark);
  --fondo-secundario: var(--secondary-color);
  --texto-principal: var(--text-color);
  --texto-secundario: var(--light-text);
  --blanco: var(--white);
  --verde-positivo: #66bb6a;
  --naranja-neutral: #ffb74d;
  --rojo-negativo: #d62727;
}

.season-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

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

.season-header h1 {
  color: var(--celeste-oscuro);
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

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

/* Tarjeta de partidos */
.matches-card {
  background: var(--blanco);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  overflow: hidden;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Esto causa el scroll en escritorio, pero lo arreglaremos en móvil */
}

.matches-table th {
  background: var(--celeste-primario);
  color: var(--blanco);
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  position: sticky;
  top: 0;
}

.matches-table td {
  padding: 1rem;
  border-top: 1px solid var(--fondo-secundario);
  vertical-align: middle;
}

.matches-table tbody tr:nth-child(odd) {
  background: var(--fondo-secundario);
}

/* Estilos para filas según resultado */
.win-row {
  border-left: 4px solid var(--verde-positivo);
}

.loss-row {
  border-left: 4px solid var(--rojo-negativo);
}

.draw-row {
  border-left: 4px solid var(--naranja-neutral);
}

/* Badges y botones */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

.local {
  background: var(--celeste-claro);
  color: var(--celeste-oscuro);
}

.visitor {
  background: var(--fondo-secundario);
  color: var(--texto-principal);
}

.team-goal {
  font-weight: 600;
  color: var(--celeste-primario);
}

.info-btn {
  color: var(--celeste-primario);
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.info-btn:hover {
  color: var(--celeste-oscuro);
  transform: scale(1.1);
}

/* =================================================================== */
/*             CÓDIGO CSS AÑADIDO PARA LA VISTA MÓVIL                  */
/* =================================================================== */

@media (max-width: 768px) {
  
  .season-container {
    padding: 1rem; /* Reducimos el padding general en pantallas pequeñas */
  }

  /* Anulamos el ancho mínimo para que la tabla no se desborde */
  .matches-table {
    min-width: 0;
  }

  /* Ocultamos la cabecera original de la tabla */
  .matches-table thead {
    display: none;
  }

  /* Convertimos cada fila en una tarjeta de resumen */
  .matches-table tr {
    display: block;
    background: var(--blanco);
    text-align: center;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    /* El borde izquierdo se sigue usando para indicar el resultado */
    border-left-width: 5px;
    border-left-style: solid;
  }

  /* Ocultamos la columna "Condición" que no es esencial en móvil */
  .matches-table td:nth-child(5) {
    display: none;
  }

  /* Cada celda se convierte en un bloque dentro de la tarjeta */
  .matches-table td {
    display: block;
    border: none;
    padding: 0;
  }

  /* --- Damos estilo a cada dato para crear una jerarquía visual --- */

  /* Rival */
  .matches-table td:nth-child(3) {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--texto-principal);
    margin-bottom: 0.5rem;
  }

  /* Resultado */
  .matches-table td:nth-child(4) {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
  }
  
  /* Fecha y Torneo */
  .matches-table td:nth-child(1),
  .matches-table td:nth-child(2) {
    font-size: 0.9rem;
    color: var(--texto-secundario);
    line-height: 1.4;
  }
  
  /* Botón de Detalles */
  .matches-table td:nth-child(6) {
    margin-top: 1rem;
  }

  .info-btn {
    font-size: 1.5rem; /* Más grande para facilitar el toque */
  }
}