/* Estilos generales */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

/* Encabezado */
.header-rifa {
  background: linear-gradient(135deg, #1a5e20, #2e7d32);
  color: #fff;
  text-align: center;
  padding: 24px 16px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.header-rifa h1 { font-size: 1.8rem; margin-bottom: 4px; }
.header-rifa p { font-size: 1rem; opacity: 0.9; }

#installBtn {
  margin-top: 12px;
  background: #fff;
  color: #1a5e20;
  border: none;
  padding: 10px 20px;
  border-radius: 24px;
  font-weight: bold;
  cursor: pointer;
}

/* Cuadrícula de animalitos */
.grid-animalitos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
  padding: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.animal-card {
  background: #fff;
  border: 2px solid #1a5e20;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.animal-card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(26, 94, 32, 0.3);
}

.animal-card.seleccionado {
  border-color: #ff9800;
  box-shadow: 0 0 0 3px #ff9800;
}

.animal-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.animal-card .numero {
  display: block;
  font-weight: bold;
  color: #1a5e20;
  font-size: 1.1rem;
  margin-top: 4px;
}

.animal-card .nombre {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 6px;
}

/* Formularios */
.formulario-registro {
  background: #fff;
  max-width: 400px;
  margin: 20px auto 40px auto;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.formulario-registro h2 {
  color: #1a5e20;
  margin-bottom: 16px;
  text-align: center;
}

.formulario-registro input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

.formulario-registro button {
  width: 100%;
  padding: 12px;
  background: #1a5e20;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
}

.formulario-registro button:hover {
  background: #2e7d32;
}

#mensajeRegistro {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: bold;
}

/* Responsivo para celulares */
@media (max-width: 480px) {
  .grid-animalitos { grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; }
  .animal-card .numero { font-size: 0.9rem; }
  .animal-card .nombre { font-size: 0.7rem; }
}
/* Estilos para la ventana flotante (Modal) */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal-content h2 {
  color: #1a5e20;
  text-align: center;
  margin-bottom: 16px;
}

.modal-content label {
  font-weight: bold;
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
/* Estilos para animalitos VENDIDOS */
.animal-card.vendido {
  background: #ffebee;
  border-color: #c62828;
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.animal-card.vendido img {
  filter: grayscale(100%); /* Pone la imagen en blanco y negro */
}

.animal-card.vendido .numero,
.animal-card.vendido .nombre {
  color: #c62828;
}

.animal-card.vendido::after {
  content: "VENDIDO";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: #c62828;
  color: white;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  pointer-events: none;
}