body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background: #f4f7f6; color: #333; margin: 0; padding: 20px; }
.container { max-width: 900px; margin: auto; text-align: center; }

/* Grid de Números */
.grid-rifa {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); /* Se ajusta solo */
    gap: 10px;
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.boleto {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 5px;
    color: white;
    transition: 0.3s;
    user-select: none;
}

/* Colores por idestado */
.estado-1 { background-color: #808080; cursor: pointer; } /* Disponible - Gris */
.estado-1:hover { background-color: #555; transform: scale(1.05); }
.estado-2 { background-color: #ffc107; cursor: pointer;transition: transform 0.2s, background-color 0.2s;} /* Pendiente - Amarillo */
.estado-2:hover {
    background-color: #dca500; /* Un verde un poco más oscuro al pasar el mouse */
    transform: scale(1.05);
}
.close { position: absolute; right: 20px; top: 10px; font-size: 28px; cursor: pointer; }
/* Añade esto a tu style.css */
.estado-3 {
    background-color: #d5172af6;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.estado-3:hover {
    background-color: #671010; /* Un verde un poco más oscuro al pasar el mouse */
    transform: scale(1.05);
}

/* Formulario */
.group { margin-bottom: 15px; text-align: left; }
.group label { display: block; margin-bottom: 5px; font-weight: bold; }
.group input { width: 100%; padding: 10px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; }
.btn-enviar { width: 100%; padding: 12px; background: #007bff; color: white; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; }
.btn-enviar:hover { background: #0056b3; }

/* --- Animaciones --- */
@keyframes animacionEntrada {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes animacionSalida {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-50px); }
}

/* --- Modal Base --- */
.modal {
    display: none; 
    position: fixed; z-index: 100; left: 0; top: 0; 
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px); /* Difumina un poco el fondo */
    transition: opacity 0.3s ease;
}

/* El contenido del modal con la animación */
.modal-content {
    background-color: white;
    margin: 8% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    
    /* Aplicar animación de entrada por defecto */
    animation: animacionEntrada 0.4s ease-out forwards;
}

/* Clase que inyectaremos con JS para cerrar con estilo */
.modal-cerrando .modal-content {
    animation: animacionSalida 0.3s ease-in forwards;
}

/* Layout Principal */
.main-content {
    display: flex;
    flex-wrap: wrap; /* Para que en celular se ponga uno abajo de otro */
    gap: 30px;
    margin-top: 20px;
    align-items: flex-start;
}

.info-rifa {
    flex: 1; /* Ocupa una parte */
    min-width: 320px;
}

.tabla-rifa {
    flex: 1.5; /* Ocupa un poco más de espacio que la info */
    min-width: 320px;
}

/* Estilo de la Tarjeta del Premio */
.card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: left;
}

.img-premio {
    width: 100%;
    height: auto;
    display: block;
}

.detalles { padding: 10px; }
.detalles h2 { margin-top: 0; color: #333; }
.lista-info { list-style: none; padding: 0; }
.lista-info li { margin-bottom: 10px; font-size: 1.1em; }

/* Leyenda de colores */
.leyenda-colores {
    margin-top: 20px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
    font-size: 0.9em;
}
.dot { height: 10px; width: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; margin-left: 10px; }
.gris { background-color: #808080; }
.amarillo { background-color: #ffc107; }
.verde { background-color: #28a745; }
.rojo { background-color: #9a1e1e; }

/* Ajuste para que la tabla de números sea scrollable en pantallas pequeñas si es necesario */
.grid-rifa {
    max-height: 80vh;
    overflow-y: auto;
    padding: 15px;
}
