.entrenador-link { 
  text-decoration: underline; 
  cursor: none; 
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.4rem;
}

.equipos-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: auto;
  text-align: center;
}

.equipos-title {
  text-align: center;
  font-family: 'Anton', sans-serif;
  color: var(--gold);
  font-size: 2.3rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  text-shadow: none;
}

.equipos-subtitle {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 2rem;
}

.equipos-filtros {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.equipos-filtros button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 0.5rem 1.2rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.equipos-filtros button:hover,
.equipos-filtros .filtro-activo {
  background: var(--gold);
  color: var(--dark);
}

.equipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.card-glow {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 1.5rem;
  color: white;
  text-align: left;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
  transition: transform 0.3s ease;

  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.card-glow > div:last-child {
  margin-top: auto;
  text-align: right;
  width: 100%;
  padding-top: 1rem;
  
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: bold;
}

.card-glow:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px rgba(191, 154, 51, 0.4);
}

.card-glow h3 {
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.card-glow p {
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
  .filtros-categorias {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }
}

.equipos-grid a {
  height: 100%; 
  display: block;
  text-decoration: none;
}

.link-detalles {
  display: flex;
  align-items: end;
  vertical-align: bottom;
}



/* --- VARIABLES Y RESET BÁSICO --- */
:root {
    --gold: #d4af37;
    --gold-dim: rgba(212, 175, 55, 0.3);
    --dark-bg: #121212;
    --card-bg: rgba(20, 20, 20, 0.85);
}

/* --- WRAPPER GENERAL --- */
.detalle-wrapper {
    padding-top: 120px; /* Espacio para el header flotante */
    padding-bottom: 50px;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: white;
}

.detalle-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Botón Volver */
.back-link-container {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.back-link {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.back-link:hover { opacity: 0.8; }

/* --- 1. HERO SECTION --- */
.team-hero {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
}

/* Imagen del equipo */
.hero-image-container {
    flex: 0 0 450px; /* Ancho fijo en escritorio */
    position: relative;
}

.hero-image-container img {
    width: 100%;
    height: 100%;       /* Cambiado de auto a 100% para llenar hasta el límite */
    max-height: 300px;  /* <--- Límite de altura solicitado */
    border-radius: 15px;
    border: 2px solid var(--gold);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.2);
    object-fit: cover;  /* IMPORTANTE: Recorta la imagen para que no se aplaste */
    /* aspect-ratio: 4/3; <-- He quitado esto para que el max-height mande libremente */
}

/* Contenedor del texto: Fuerza a que todo dentro se alinee a la izquierda */
.hero-content {
    flex: 1;
    text-align: left;        /* Alinea texto general */
    display: flex;           /* Usamos flex para controlar mejor la caja del entrenador */
    flex-direction: column;  /* Organiza título, caja y descripción en columna */
    align-items: flex-start; /* IMPORTANTE: Pega los elementos flexibles (como la caja del entrenador) a la izquierda */
}

/* Corrección del selector del título */
.team-title { 
    text-align: left;
    margin-top: 0; /* Opcional: quita espacio extra arriba si lo hubiera */
}

.team-title {
    font-family: 'Anton', sans-serif;
    font-size: 4rem;
    color: var(--gold);
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 1rem;
    margin: 0 0 0.5rem 0;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.team-category-label {
    font-size: 1rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    font-weight: 400;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
    display: inline-block;
}

.trainer-box {
    background: rgba(255, 255, 255, 0);
    padding: 12px 0px;
    display: inline-block;
}

.trainer-box .label { 
    color: var(--gold); 
    font-weight: bold; 
    margin-right: 10px; 
    text-transform: uppercase;
    font-size: 0.9rem;
}
.trainer-box .value { 
    color: white; 
    font-size: 1.1rem; 
}

.team-description {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 650px;
}

/* --- 2. DASHBOARD (Tarjetas Info) --- */
.team-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
}

.dash-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--gold-dim);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-height: 275px;
    position: relative;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.dash-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
}

.card-title {
    color: var(--gold);
    font-family: 'Anton', sans-serif;
    letter-spacing: 1px;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Info Entrenamientos */
.big-data { font-size: 1.4rem; color: white; font-weight: bold; margin-bottom: 0.5rem; text-transform: capitalize; }
.small-data { font-size: 1.3rem; color: #aaa; }

/* Info Liga */
.league-img { max-height: 100px; max-width: 85%;; width: auto; object-fit: contain; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); }

/* --- 3. ESTILOS PARTIDO (FIREBASE) --- */
.match-card {
    /* Fondo degradado oscuro para destacar */
    background: linear-gradient(145deg, rgba(20,20,20,0.95), rgba(45,40,10,0.4));
    border: 1px solid var(--gold);
}

.countdown-badge {
    position: absolute;
    top: -14px;
    background: #eee;
    color: #000;
    font-weight: 800;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    letter-spacing: 1px;
    z-index: 2;
}

.match-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

.team-logo { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 10px; 
    width: 40%; 
}
.team-logo img { 
    width: 60px; 
    height: 60px; 
    object-fit: contain; 
}
.team-logo span { 
    font-size: 0.85rem; 
    font-weight: bold; 
    color: white; 
    line-height: 1.2; 
    text-transform: uppercase;
}

.vs { 
    font-family: 'Anton', sans-serif; 
    font-size: 2rem; 
    color: #555; 
}

.match-info {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
    width: 100%;
    font-size: 0.9rem;
    color: #ddd;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.location-text {
    width: 100%;
    color: var(--gold);
    font-weight: 500;
    margin-top: 5px;
    font-size: 0.85rem;
}

/* --- 4. TABLA PLANTILLA --- */
.plantilla-section { margin-bottom: 3rem; }

.section-title {
    font-family: 'Anton', sans-serif;
    font-size: 2.5rem;
    color: white;
    border-left: 5px solid var(--gold);
    padding-left: 15px;
    margin-bottom: 2rem;
}

.table-responsive { overflow-x: auto; }

.roster-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0; 
    background: transparent;
}

.roster-table th {
    text-align: left;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gold-dim);
    color: var(--gold);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.roster-table td {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: white;
    font-size: 1rem;
    vertical-align: middle;
}

.roster-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

/* El círculo del dorsal */
.dorsal-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--gold);
    color: black;
    font-weight: 800;
    border-radius: 50%;
    font-size: 1rem;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    margin: 0 auto; /* Centrado */
}

/* --- RESPONSIVE --- */
@media (max-width: 968px) {
    .team-hero { 
        flex-direction: column; 
        text-align: center; 
        gap: 2rem; 
    }
    .hero-image-container { 
        flex: auto; 
        width: 100%; 
        max-width: 500px; 
    }
    .team-title { font-size: 3rem; }
    .team-description { margin: 0 auto; }
}

@media (max-width: 600px) {
    .detalle-wrapper { padding-top: 100px; }
    .team-title { font-size: 2.5rem; }
    .dash-card { padding: 1.5rem; }
    .vs { font-size: 1.5rem; }
    .team-logo img { width: 45px; height: 45px; }
    .roster-table th, .roster-table td { padding: 1rem 0.8rem; font-size: 0.9rem; }
}


/* --- ESTILOS VISUALES PLANTILLA (CAMISETAS) --- */

.plantilla-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.position-group {
    margin-bottom: 2rem;
}

.position-title {
    color: var(--gold);
    font-family: 'Anton', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    display: inline-block;
    padding-right: 2rem;
}

.roster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 2rem;
    justify-items: center;
}

.player-card {
    position: relative;
    width: 100%;
    max-width: 200px;
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.player-card:hover {
    transform: translateY(-10px);
}

/* Contenedor de la imagen y el número */
.jersey-visual {
    position: relative;
    width: 100%;
    /* Ajusta esto según el tamaño de tus imágenes de camiseta */
    aspect-ratio: 1 / 1.1; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.jersey-img {
    width: 75%;
    height: 75%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
}

/* El número superpuesto */
.player-number-overlay {
    position: absolute;
    top: 37%; /* Ajusta según el diseño de tu camiseta */
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Anton', sans-serif;
    font-size: 1.25rem;
    color: #e0e0e0; /* Color del número (blanco/gris claro) */
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    z-index: 2;
}

/* Color específico para números en camiseta blanca (Líberos) */
.libero-number {
    color: #664f0d; /* Número oscuro para fondo claro */
}

/* Textos (Nombre y Apodo) */
.player-info {
    margin-top: 0.5rem;
}

.player-name {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.player-role {
    color: var(--gold);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Iconos del partido */
.match-icon {
    width: 18px;       /* Tamaño del icono */
    height: 18px;
    vertical-align: text-bottom; /* Alineación con el texto */
    margin-right: 6px; /* Espacio entre icono y texto */
    /* Si tus iconos son negros y el fondo oscuro, usa esto para volverlos blancos: */
    /* filter: invert(1); */ 
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: center;
}