* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: url('/IMAGENES/fondo.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.carta {
  width: 90%;
  max-width: 400px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: white;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lider {
  width: 90px;
  height: 140px;
  margin: auto;
  border-radius: 12px; 
  object-fit: cover;
}

.iden {
  font-size: 22px;
  color: #333;
  margin-top: 15px;
  font-weight: bold;
}

.cartita {
  width: 100%;
  border-radius: 10px;
  margin: auto;
}

.cartita img {
  width: 150px;
  height: auto;
  margin: 0 auto 15px auto;
  border-radius: 50%;
}

.titulo {
  font-size: 22px;
  color: #333;
  margin-bottom: 30px;
  font-weight: bold;
}

/* --- Contenedor de botones cuadrados --- */
.botones-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.boton-cuadrado {
  width: 140px;
  height: 140px;
  border: none;
  border-radius: 15px;
  background-color: #007BFF;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.icono-trofeo,
.icono-personas {
  font-size: 48px;
  display: block;
}

.texto-boton {
  font-size: 14px;
    display: block;
}

/* --- Estilos de Modal --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-inscritos-content {
  max-width: 450px;
}

.modal-header {
  text-align: center;
  margin-bottom: 25px;
  border-bottom: 3px solid #007BFF;
  padding-bottom: 15px;
}

.modal-header h2 {
  font-size: 28px;
  color: #333;
  margin: 0 0 8px 0;
}

.subtitle {
  color: #666;
  font-size: 14px;
  margin: 0;
  font-weight: normal;
}

.close {
  color: #999;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
}

.close:hover,
.close:focus {
  color: #333;
}

.modal-body {
  padding: 20px 0;
}

/* --- Tabla de Rankings --- */
.rankings-table {
  max-height: 500px;
  overflow-y: auto;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 15px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #f8f9fa 0%, #ffffff 100%);
  border-left: 4px solid #007BFF;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.ranking-item:hover {
  background: linear-gradient(90deg, #e8eef5 0%, #f0f5ff 100%);
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.posicion {
  font-size: 24px;
  font-weight: bold;
  width: 50px;
  text-align: center;
  color: #007BFF;
  margin-right: 15px;
}

.posicion.top1 {
  color: #FFD700;
  font-size: 28px;
}

.posicion.top2 {
  color: #C0C0C0;
}

.posicion.top3 {
  color: #CD7F32;
}

.ranking-info {
  flex-grow: 1;
}

.ranking-nombre {
  font-weight: bold;
  color: #333;
  font-size: 16px;
  margin-bottom: 5px;
}

.ranking-referidos {
  color: #666;
  font-size: 14px;
}

.ranking-numero {
  background: linear-gradient(135deg, #007BFF 0%, #0056b3 100%);
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 14px;
  min-width: 60px;
  text-align: center;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 16px;
}

/* --- Modal Inscritos --- */
.modal-inscritos-body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.inscritos-card {
  text-align: center;
}

.numero-grande {
  font-size: 80px;
  font-weight: bold;
  background: linear-gradient(135deg, #007BFF 0%, #0056b3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 20px 0;
}

.texto-inscritos {
  color: #666;
  font-size: 18px;
  margin-top: 20px;
}

.carta label {
  display: block;
  margin: 10px auto 5px;
  color: #555;
  font-size: 18px;
}

.carta input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.carta button {
  display: block;
  padding: 12px;
  width: 100%;
  margin-top: 20px;
  font-size: 18px;
  border: none;
  border-radius: 5px;
  background-color: #007BFF;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.carta button:hover {
  background-color: #0056b3;
}

.btn-inscribete {
  display: inline-block;
  padding: 12px;
  width: 80%;
  margin-top: 16px;
  font-size: 18px;
  text-decoration: none;
  border-radius: 5px;
  background-color: #007BFF;
  color: white;
  text-align: center;
  cursor: pointer;
}

.btn-inscribete:hover {
  background-color: #0056b3;
}

.form-footer {
  margin-top: 20px;
}


/* --- Ajustes adicionales para pantallas pequeñas --- */
@media (max-width: 480px) {
  .titulo {
    font-size: 20px;
  }

  .carta label {
    font-size: 16px;
  }

  .carta button {
    font-size: 16px;
  }

  .carta img {
    width: 120px;
  }

  .boton-cuadrado {
    width: 120px;
    height: 120px;
    font-size: 14px;
    gap: 8px;
  }

  .icono-trofeo,
  .icono-personas {
    font-size: 40px;
  }

  .botones-container {
    gap: 15px;
  }

  .modal-content {
    width: 95%;
    margin: 20% auto;
    padding: 20px;
  }

  .modal-header h2 {
    font-size: 24px;
  }

  .ranking-item {
    padding: 12px;
  }

  .posicion {
    width: 40px;
    font-size: 20px;
  }

  .numero-grande {
    font-size: 60px;
  }

  .texto-inscritos {
    font-size: 16px;
  }
}
